diff --git a/ChangeLog b/ChangeLog index b650ec5d4..6f27f9707 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,27 +1,48 @@ -Wed Feb 12 14:14:47 1997 GNUstep Development +Mon Feb 17 19:30:50 1997 Ovidiu Predescu - * Initial implementation of NSCursor. - * Headers/gnustep/gui/NSCursor.h: Likewise. - * Source/NSCursor.m: Likewise. - * Headers/gnustep/gui/NSWindow.h: Implement cursor rectangles. - * Source/NSView.m: Likewise. - * Source/NSWindow.m: Likewise. - * Source/Makefile.in: Clean up variables - * Source/NSApplication.m: Fixes to event posting. Unhide the - cursor when a mouse event occurs. - * Source/NSEvent.m: NSCursorUpdate events are implemented - as enter/exit events instead of other events. - * Headers/gnustep/gui/NSTextField.h: Add text field cursor. - * Source/NSTextField.m: Likewise. + * Source/NSButton.m: New methods -setAlignment: and -alignment, + setIntValue:, setFloatValue:, setDoubleValue:, setAlignment:, + alignment. + * Source/NSButtonCell.m: setType: changed to setButtonType:. Changed + the way in which the button types are handled (use highlightsBy and + showsStateBy attributes). Fixed some object allocation retain/release + problems. setHighlightsBy: and setShowsStateBy: implemented. New + methods setIntValue:, setFloatValue:, setDoubleValue:, intValue, + floatValue, doubleValue. Fixed coding methods. + * Source/NSCell.m: Fixed some object allocation problems. Changed the + way in which setIntValue:, setFloatValue: and setDoubleValue: work. + Commented out a point conversion that works wrong (why?). -Thu Feb 6 19:31:54 1997 GNUstep Development +Sat Feb 15 23:12:35 1997 Ovidiu Predescu - * Fill out implementation of NSColorWell. - * Headers/gnustep/gui/NSColorWell.h: Add backend instance variable - and backend method. - * Source/NSColorWell.m: Initial implementation. - * NSView.m: Don't use -isKindOfClass: because it isn't working - as we expect with the backend classes doing a +poseAs: + * Major reorganization of header files. Types and constants were moved + in the files they belong (too many to enumerate here). Each header + file includes only the headers it really needs. Use @class to forward + class definitions instead of including the corresponding class file. + * Headers/gnustep/gui/Functions.h: Removed. + * Headers/gnustep/gui/NSBundle.h: Removed. + * Headers/gnustep/gui/NSFontPrivate.h: Removed. + * Headers/gnustep/gui/TypesandConstants.h: Removed. + * Headers/gnustep/gui/stdappkit.h: Removed. + * Headers/gnustep/gui/NSGraphichs.h: New file. + * Headers/gnustep/gui/AppKitExceptions.h: New file. A place to put + exception strings that don't belong elsewhere. + * Headers/gnustep/gui/NSNibLoading.h: Added category to NSBundle that + deals with nib loading. + +Mon Feb 10 17:23:06 1997 Ovidiu Predescu + + * Source/NSFont.m: Completely reworked. Get the default fonts using + the NSUserDefaults class instead of hard-coding them. Almost all the + methods have to be overwritten in the true backend class. + * Headers/gnustep/gui/NSFont.h: Removed unnecessary instance variables. + Define some particular glyph types. + * Source/NSFontManager.m: Commented out the methods that converts + between different fonts and traits. + * Source/Makefile: Define GNUSTEP_INSTALL_LIBDIR directly as string. + * Source/NSImage.m: GNUSTEP_INSTALL_LIBDIR is passed as string during + compilation so don't use OBJC_STRINGIFY. Use an OpenStep method to + search for a resource instead of the particular gnustep-base method. Fri Jan 31 05:30:40 1997 Scott Christley @@ -101,6 +122,15 @@ Thu Jan 23 15:10:13 1997 Scott Christley defined in NSApplication. * Source/NSTextFieldCell.m (-initWithFrame:): Bezeled by default. +Tue Jan 14 9:33:04 1997 Ovidiu Predescu + + * Source/Functions.m: Exclude from compiling the NSLog functions when + working with libFoundation. + * Source/NSBundle.m: Renamed to NSBundleAdditions.m to make possible + create a shared library under OS 4.1. + * Changed the -encodeWithCoder: and -initWithCoder: methods in all + classes to work with the basic NSCoder methods. + Thu Dec 5 06:58:51 1996 GNUstep Development * Source/NSColorList.m: Fill out implementation. diff --git a/Headers/gnustep/dps/DPSOperators.h b/Headers/gnustep/dps/DPSOperators.h index 7b44c4d99..ad295a657 100644 --- a/Headers/gnustep/dps/DPSOperators.h +++ b/Headers/gnustep/dps/DPSOperators.h @@ -29,6 +29,8 @@ #ifndef _GNUstep_H_DPSOperators #define _GNUstep_H_DPSOperators +#include + // Use the DPSclient library if we have it #ifdef HAVE_DPSCLIENT diff --git a/Headers/gnustep/dps/NSDPSContext.h b/Headers/gnustep/dps/NSDPSContext.h index c516d9330..cfc5a99f3 100644 --- a/Headers/gnustep/dps/NSDPSContext.h +++ b/Headers/gnustep/dps/NSDPSContext.h @@ -29,10 +29,12 @@ #ifndef _GNUstep_H_NSDPSContext #define _GNUstep_H_NSDPSContext -#include #include -#include #include +#include + +@class NSData; +@class NSMutableData; // // NSDPSContextNotification diff --git a/Headers/gnustep/dps/TypesandConstants.h b/Headers/gnustep/dps/TypesandConstants.h index ce1047fe1..08942450c 100644 --- a/Headers/gnustep/dps/TypesandConstants.h +++ b/Headers/gnustep/dps/TypesandConstants.h @@ -29,6 +29,10 @@ #ifndef _GNUstep_H_DPSTypes #define _GNUstep_H_DPSTypes +#include + +@class NSString; + // These are already defined in the DPSclient headers #ifndef HAVE_DPSCLIENT typedef void *DPSProgramEncoding; diff --git a/Headers/gnustep/gui/.cvsignore b/Headers/gnustep/gui/.cvsignore new file mode 100644 index 000000000..0e56cf2f8 --- /dev/null +++ b/Headers/gnustep/gui/.cvsignore @@ -0,0 +1 @@ +config.h diff --git a/Headers/gnustep/gui/AppKit.h b/Headers/gnustep/gui/AppKit.h index d3826e8f7..fa9c2f648 100644 --- a/Headers/gnustep/gui/AppKit.h +++ b/Headers/gnustep/gui/AppKit.h @@ -29,8 +29,6 @@ #ifndef _GNUstep_H_AppKit #define _GNUstep_H_AppKit -#include - // // System dependent information // @@ -42,15 +40,10 @@ float MB_SCREEN_MAXHEIGHT(); // #include -// -// Types and Constants for GNUstep GUI Library -// -#include - // // GNUstep GUI Library functions // -#include +#include // // Protocols @@ -148,7 +141,4 @@ float MB_SCREEN_MAXHEIGHT(); #include #include -#include -#include - #endif _GNUstep_H_AppKit diff --git a/Headers/gnustep/gui/AppKitExceptions.h b/Headers/gnustep/gui/AppKitExceptions.h new file mode 100644 index 000000000..a16c7fcea --- /dev/null +++ b/Headers/gnustep/gui/AppKitExceptions.h @@ -0,0 +1,67 @@ +/* + AppKitExceptions.h + + Copyright (C) 1996 Free Software Foundation, Inc. + + Author: Ovidiu Predescu + Date: February 1997 + + This file is part of the GNUstep GUI Library. + + This library is free software; you can redistribute it and/or + modify it under the terms of the GNU Library General Public + License as published by the Free Software Foundation; either + version 2 of the License, or (at your option) any later version. + + This library is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + Library General Public License for more details. + + You should have received a copy of the GNU Library General Public + License along with this library; if not, write to the Free + Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. +*/ +#ifndef __AppKit_AppKitExceptions_h__ +#define __AppKit_AppKitExceptions_h__ + +@class NSString; + +extern NSString *NSAbortModalException; +extern NSString *NSAbortPrintingException; +extern NSString *NSAppKitIgnoredException; +extern NSString *NSAppKitVirtualMemoryException; +extern NSString *NSBadBitmapParametersException; +extern NSString *NSBadComparisonException; +extern NSString *NSBadRTFColorTableException; +extern NSString *NSBadRTFDirectiveException; +extern NSString *NSBadRTFFontTableException; +extern NSString *NSBadRTFStyleSheetException; +extern NSString *NSBrowserIllegalDelegateException; +extern NSString *NSColorListIOException; +extern NSString *NSColorListNotEditableException; +extern NSString *NSDraggingException; +extern NSString *NSFontUnavailableException; +extern NSString *NSIllegalSelectorException; +extern NSString *NSImageCacheException; +extern NSString *NSNibLoadingException; +extern NSString *NSPPDIncludeNotFoundException; +extern NSString *NSPPDIncludeStackOverflowException; +extern NSString *NSPPDIncludeStackUnderflowException; +extern NSString *NSPPDParseException; +extern NSString *NSPasteboardCommunicationException; +extern NSString *NSPrintOperationExistsException; +extern NSString *NSPrintPackageException; +extern NSString *NSPrintingCommunicationException; +extern NSString *NSRTFPropertyStackOverflowException; +extern NSString *NSTIFFException; +extern NSString *NSTextLineTooLongException; +extern NSString *NSTextNoSelectionException; +extern NSString *NSTextReadException; +extern NSString *NSTextWriteException; +extern NSString *NSTypedStreamVersionException; +extern NSString *NSWindowServerCommunicationException; +extern NSString *NSWordTablesReadException; +extern NSString *NSWordTablesWriteException; + +#endif /* __AppKit_AppKitExceptions_h__ */ diff --git a/Headers/gnustep/gui/Functions.h b/Headers/gnustep/gui/Functions.h deleted file mode 100644 index 22d372f6e..000000000 --- a/Headers/gnustep/gui/Functions.h +++ /dev/null @@ -1,248 +0,0 @@ -/* - Functions.h - - Generic functions for the GNUstep GUI Library - - Copyright (C) 1996 Free Software Foundation, Inc. - - Author: Scott Christley - Date: 1996 - - This file is part of the GNUstep GUI Library. - - This library is free software; you can redistribute it and/or - modify it under the terms of the GNU Library General Public - License as published by the Free Software Foundation; either - version 2 of the License, or (at your option) any later version. - - This library is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - Library General Public License for more details. - - You should have received a copy of the GNU Library General Public - License along with this library; see the file COPYING.LIB. - If not, write to the Free Software Foundation, - 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. -*/ - -#ifndef _GNUstep_H_AppKitFunctions -#define _GNUstep_H_AppKitFunctions - -#include -#include - -@class NSPasteboard, NSColor; - -// -// Rectangle Drawing Functions -// -// -// Optimize Drawing -// -void NSEraseRect(NSRect aRect); -void NSHighlightRect(NSRect aRect); -void NSRectClip(NSRect aRect); -void NSRectClipList(const NSRect *rects, int count); -void NSRectFill(NSRect aRect); -void NSRectFillList(const NSRect *rects, int count); -void NSRectFillListWithGrays(const NSRect *rects, - const float *grays, int count); - -// -// Draw a Bordered Rectangle -// -void NSDrawButton(NSRect aRect, NSRect clipRect); -void NSDrawGrayBezel(NSRect aRect, NSRect clipRect); -void NSDrawGroove(NSRect aRect, NSRect clipRect); -NSRect NSDrawTiledRects(NSRect boundsRect, NSRect clipRect, - const NSRectEdge *sides, const float *grays, - int count); -void NSDrawWhiteBezel(NSRect aRect, NSRect clipRect); -void NSFrameRect(NSRect aRect); -void NSFrameRectWithWidth(NSRect aRect, float frameWidth); - -// -// Color Functions -// -// -// Get Information About Color Space and Window Depth -// -const NSWindowDepth *NSAvailableWindowDepths(void); -NSWindowDepth NSBestDepth(NSString *colorSpace, - int bitsPerSample, int bitsPerPixel, - BOOL planar, BOOL *exactMatch); -int NSBitsPerPixelFromDepth(NSWindowDepth depth); -int NSBitsPerSampleFromDepth(NSWindowDepth depth); -NSString *NSColorSpaceFromDepth(NSWindowDepth depth); -int NSNumberOfColorComponents(NSString *colorSpaceName); -BOOL NSPlanarFromDepth(NSWindowDepth depth); - -// -// Read the Color at a Screen Position -// -NSColor *NSReadPixel(NSPoint location); - -// -// Text Functions -// -// -// Filter Characters Entered into a Text Object -// -unsigned short NSEditorFilter(unsigned short theChar, - int flags, NSStringEncoding theEncoding); -unsigned short NSFieldFilter(unsigned short theChar, - int flags, NSStringEncoding theEncoding); - -// -// Calculate or Draw a Line of Text (in Text Object) -// -int NSDrawALine(id self, NSLayInfo *layInfo); -int NSScanALine(id self, NSLayInfo *layInfo); - -// -// Calculate Font Ascender, Descender, and Line Height (in Text Object) -// -void NSTextFontInfo(id fid, - float *ascender, float *descender, - float *lineHeight); - -// -// Access Text Object's Word Tables -// -NSData * NSDataWithWordTable(const unsigned char *smartLeft, - const unsigned char *smartRight, - const unsigned char *charClasses, - const NSFSM *wrapBreaks, - int wrapBreaksCount, - const NSFSM *clickBreaks, - int clickBreaksCount, - BOOL charWrap); -void NSReadWordTable(NSZone *zone, - NSData *data, - unsigned char **smartLeft, - unsigned char **smartRight, - unsigned char **charClasses, - NSFSM **wrapBreaks, - int *wrapBreaksCount, - NSFSM **clickBreaks, - int *clickBreaksCount, - BOOL *charWrap); - -// -// Array Allocation Functions for Use by the NSText Class -// -NSTextChunk *NSChunkCopy(NSTextChunk *pc, NSTextChunk *dpc); -NSTextChunk *NSChunkGrow(NSTextChunk *pc, int newUsed); -NSTextChunk *NSChunkMalloc(int growBy, int initUsed); -NSTextChunk *NSChunkRealloc(NSTextChunk *pc); -NSTextChunk *NSChunkZoneCopy(NSTextChunk *pc, - NSTextChunk *dpc, - NSZone *zone); -NSTextChunk *NSChunkZoneGrow(NSTextChunk *pc, int newUsed, NSZone *zone); -NSTextChunk *NSChunkZoneMalloc(int growBy, int initUsed, NSZone *zone); -NSTextChunk *NSChunkZoneRealloc(NSTextChunk *pc, NSZone *zone); - -// -// Imaging Functions -// -// -// Copy an image -// -void NSCopyBitmapFromGState(int srcGstate, NSRect srcRect, NSRect destRect); -void NSCopyBits(int srcGstate, NSRect srcRect, NSPoint destPoint); - -// -// Render Bitmap Images -// -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]); - -// -// Attention Panel Functions -// -// -// Create an Attention Panel without Running It Yet -// -id NSGetAlertPanel(NSString *title, - NSString *msg, - NSString *defaultButton, - NSString *alternateButton, - NSString *otherButton, ...); - -// -// Create and Run an Attention Panel -// -int NSRunAlertPanel(NSString *title, - NSString *msg, - NSString *defaultButton, - NSString *alternateButton, - NSString *otherButton, ...); -int NSRunLocalizedAlertPanel(NSString *table, - NSString *title, - NSString *msg, - NSString *defaultButton, - NSString *alternateButton, - NSString *otherButton, ...); - -// -// Release an Attention Panel -// -void NSReleaseAlertPanel(id panel); - -// -// Services Menu Functions -// -// -// Determine Whether an Item Is Included in Services Menus -// -int NSSetShowsServicesMenuItem(NSString *item, BOOL showService); -BOOL NSShowsServicesMenuItem(NSString *item); - -// -// Programmatically Invoke a Service -// -BOOL NSPerformService(NSString *item, NSPasteboard *pboard); - -// -// Force Services Menu to Update Based on New Services -// -void NSUpdateDynamicServices(void); - -// -// Other GNUstep GUI Library Functions -// -// -// Play the System Beep -// -void NSBeep(void); - -// -// Return File-related Pasteboard Types -// -NSString *NSCreateFileContentsPboardType(NSString *fileType); -NSString *NSCreateFilenamePboardType(NSString *filename); -NSString *NSGetFileType(NSString *pboardType); -NSArray *NSGetFileTypes(NSArray *pboardTypes); - -// -// Draw a Distinctive Outline around Linked Data -// -void NSFrameLinkRect(NSRect aRect, BOOL isDestination); -float NSLinkFrameThickness(void); - -// -// Convert an Event Mask Type to a Mask -// -unsigned int NSEventMaskFromType(NSEventType type); - -#endif // _GNUstep_H_AppKitFunctions diff --git a/Headers/gnustep/gui/NSActionCell.h b/Headers/gnustep/gui/NSActionCell.h index 6f2548b94..568b805f1 100644 --- a/Headers/gnustep/gui/NSActionCell.h +++ b/Headers/gnustep/gui/NSActionCell.h @@ -29,12 +29,9 @@ #ifndef _GNUstep_H_NSActionCell #define _GNUstep_H_NSActionCell -#include #include -#include @interface NSActionCell : NSCell - { // Attributes int tag; @@ -51,25 +48,17 @@ - (void)setEnabled:(BOOL)flag; - (void)setFloatingPointFormat:(BOOL)autoRange left:(unsigned int)leftDigits -right:(unsigned int)rightDigits; + right:(unsigned int)rightDigits; - (void)setFont:(NSFont *)fontObject; - (void)setImage:(NSImage *)image; // // Manipulating NSActionCell Values // -- (double)doubleValue; -- (float)floatValue; -- (int)intValue; +- (void)setIntValue:(int)anInt; +- (void)setFloatValue:(float)aFloat; +- (void)setDoubleValue:(double)aDouble; - (void)setStringValue:(NSString *)aString; -- (NSString *)stringValue; - -// -// Displaying -// -- (void)drawWithFrame:(NSRect)cellFrame - inView:(NSView *)controlView; -- (NSView *)controlView; // // Target and Action diff --git a/Headers/gnustep/gui/NSApplication.h b/Headers/gnustep/gui/NSApplication.h index 0c3f99cd7..fa2aa307d 100644 --- a/Headers/gnustep/gui/NSApplication.h +++ b/Headers/gnustep/gui/NSApplication.h @@ -29,28 +29,41 @@ #ifndef _GNUstep_H_NSApplication #define _GNUstep_H_NSApplication -#include -#include -#include -#include #include -#include -#include -#include -#include -#include -#include -#include -#include +@class NSArray; +@class NSMutableArray; +@class NSString; +@class NSException; +@class NSNotification; +@class NSDate; + +@class NSEvent; @class NSPasteboard; +@class NSMenu; +@class NSMenuCell; +@class NSImage; +@class NSWindow; +@class NSDPSContext; + +extern id NSApp; + +typedef struct _NSModalSession *NSModalSession; + +enum { + NSRunStoppedResponse, + NSRunAbortedResponse, + NSRunContinuesResponse +}; + +extern NSString *NSModalPanelRunLoopMode; +extern NSString *NSEventTrackingRunLoopMode; @interface NSApplication : NSResponder - { // Attributes NSMutableArray *window_list; - Queue *event_queue; + NSMutableArray *event_queue; NSEvent *current_event; id key_window; id main_window; @@ -268,4 +281,36 @@ @end +// +// Notifications +// +extern NSString *NSApplicationDidBecomeActiveNotification; +extern NSString *NSApplicationDidFinishLaunchingNotification; +extern NSString *NSApplicationDidHideNotification; +extern NSString *NSApplicationDidResignActiveNotification; +extern NSString *NSApplicationDidUnhideNotification; +extern NSString *NSApplicationDidUpdateNotification; +extern NSString *NSApplicationWillBecomeActiveNotification; +extern NSString *NSApplicationWillFinishLaunchingNotification; +extern NSString *NSApplicationWillHideNotification; +extern NSString *NSApplicationWillResignActiveNotification; +extern NSString *NSApplicationWillUnhideNotification; +extern NSString *NSApplicationWillUpdateNotification; + +// +// Determine Whether an Item Is Included in Services Menus +// +int NSSetShowsServicesMenuItem(NSString *item, BOOL showService); +BOOL NSShowsServicesMenuItem(NSString *item); + +// +// Programmatically Invoke a Service +// +BOOL NSPerformService(NSString *item, NSPasteboard *pboard); + +// +// Force Services Menu to Update Based on New Services +// +void NSUpdateDynamicServices(void); + #endif // _GNUstep_H_NSApplication diff --git a/Headers/gnustep/gui/NSBitmapImageRep.h b/Headers/gnustep/gui/NSBitmapImageRep.h index 48d9fa0eb..604f7c37f 100644 --- a/Headers/gnustep/gui/NSBitmapImageRep.h +++ b/Headers/gnustep/gui/NSBitmapImageRep.h @@ -29,13 +29,25 @@ #ifndef _GNUstep_H_NSBitmapImageRep #define _GNUstep_H_NSBitmapImageRep -#include #include -#include -#include + +@class NSArray; +@class NSString; +@class NSData; +@class NSMutableData; + +typedef enum _NSTIFFCompression { + NSTIFFCompressionNone = 1, + NSTIFFCompressionCCITTFAX3 = 3, + NSTIFFCompressionCCITTFAX4 = 4, + NSTIFFCompressionLZW = 5, + NSTIFFCompressionJPEG = 6, + NSTIFFCompressionNEXT = 32766, + NSTIFFCompressionPackBits = 32773, + NSTIFFCompressionOldJPEG = 32865 +} NSTIFFCompression; @interface NSBitmapImageRep : NSImageRep - { // Attributes unsigned int bytesPerRow; diff --git a/Headers/gnustep/gui/NSBox.h b/Headers/gnustep/gui/NSBox.h index 40f909e75..504687161 100644 --- a/Headers/gnustep/gui/NSBox.h +++ b/Headers/gnustep/gui/NSBox.h @@ -29,15 +29,23 @@ #ifndef _GNUstep_H_NSBox #define _GNUstep_H_NSBox -#include #include -#include -#include + +@class NSString; +@class NSFont; + +typedef enum _NSTitlePosition { + NSNoTitle, + NSAboveTop, + NSAtTop, + NSBelowTop, + NSAboveBottom, + NSAtBottom, + NSBelowBottom +} NSTitlePosition; @interface NSBox : NSView - { -@protected // Attributes id cell; id content_view; diff --git a/Headers/gnustep/gui/NSBrowser.h b/Headers/gnustep/gui/NSBrowser.h index 979d3e25d..10c9a60cb 100644 --- a/Headers/gnustep/gui/NSBrowser.h +++ b/Headers/gnustep/gui/NSBrowser.h @@ -29,14 +29,16 @@ #ifndef _GNUstep_H_NSBrowser #define _GNUstep_H_NSBrowser -#include #include -#include -#include -#include + +@class NSString; +@class NSArray; + +@class NSCell; +@class NSMatrix; +@class NSScroller; @interface NSBrowser : NSControl - { // Attributes } @@ -130,7 +132,7 @@ // - (void)drawTitle:(NSString *)title inRect:(NSRect)aRect -ofColumn:(int)column; + ofColumn:(int)column; - (BOOL)isTitled; - (void)setTitled:(BOOL)flag; - (void)setTitle:(NSString *)aString @@ -184,28 +186,6 @@ ofColumn:(int)column; // - (void)tile; -// -// Methods Implemented by the Delegate -// -- (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 - selectCell:(NSString *)title -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; - // // NSCoding protocol // @@ -214,4 +194,32 @@ column:(int)column; @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 + selectCell:(NSString *)title + inColumn:(int)column; +- (NSString *)browser:(NSBrowser *)sender + titleOfColumn:(int)column; +- (void)browser:(NSBrowser *)sender + willDisplayCell:(id)cell + atRow:(int)row + column:(int)column; +- (void)browserDidScroll:(NSBrowser *)sender; +- (void)browserWillScroll:(NSBrowser *)sender; + +@end + + #endif // _GNUstep_H_NSBrowser diff --git a/Headers/gnustep/gui/NSBrowserCell.h b/Headers/gnustep/gui/NSBrowserCell.h index adb636551..4c00f3fe0 100644 --- a/Headers/gnustep/gui/NSBrowserCell.h +++ b/Headers/gnustep/gui/NSBrowserCell.h @@ -29,12 +29,11 @@ #ifndef _GNUstep_H_NSBrowserCell #define _GNUstep_H_NSBrowserCell -#include #include -#include + +@class NSImage; @interface NSBrowserCell : NSCell - { // Attributes } diff --git a/Headers/gnustep/gui/NSBundle.h b/Headers/gnustep/gui/NSBundle.h deleted file mode 100644 index c7e802dfc..000000000 --- a/Headers/gnustep/gui/NSBundle.h +++ /dev/null @@ -1,51 +0,0 @@ -/* - NSBundle.h - - Category of additional methods used by GUI Library. - - Copyright (C) 1996 Free Software Foundation, Inc. - - Author: Scott Christley - Date: 1996 - - This file is part of the GNUstep GUI Library. - - This library is free software; you can redistribute it and/or - modify it under the terms of the GNU Library General Public - License as published by the Free Software Foundation; either - version 2 of the License, or (at your option) any later version. - - This library is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - Library General Public License for more details. - - You should have received a copy of the GNU Library General Public - License along with this library; see the file COPYING.LIB. - If not, write to the Free Software Foundation, - 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. -*/ - -#ifndef _GNUstep_H_NSBundleAdditions -#define _GNUstep_H_NSBundleAdditions - -#include -#include - -@interface NSBundle (NSBundleAdditions) - -- (NSString *)pathForImageResource:(NSString *)name; - -+ (BOOL)loadNibFile:(NSString *)fileName - externalNameTable:(NSDictionary *)context - withZone:(NSZone *)zone; - -+ (BOOL)loadNibNamed:(NSString *)aNibName - owner:(id)owner; - -@end - -#endif // _GNUstep_H_NSBundleAdditions - - - diff --git a/Headers/gnustep/gui/NSButton.h b/Headers/gnustep/gui/NSButton.h index 02e3d890b..dec211ed5 100644 --- a/Headers/gnustep/gui/NSButton.h +++ b/Headers/gnustep/gui/NSButton.h @@ -29,13 +29,13 @@ #ifndef _GNUstep_H_NSButton #define _GNUstep_H_NSButton -#include #include -#include -#include +#include + +@class NSString; +@class NSEvent; @interface NSButton : NSControl - { // Attributes } @@ -49,7 +49,7 @@ // // Setting the Button Type // -- (void)setType:(NSButtonType)aType; +- (void)setButtonType:(NSButtonType)aType; // // Setting the State diff --git a/Headers/gnustep/gui/NSButtonCell.h b/Headers/gnustep/gui/NSButtonCell.h index b3b0ac7d0..103ae2a94 100644 --- a/Headers/gnustep/gui/NSButtonCell.h +++ b/Headers/gnustep/gui/NSButtonCell.h @@ -29,20 +29,32 @@ #ifndef _GNUstep_H_NSButtonCell #define _GNUstep_H_NSButtonCell -#include #include -#include -#include -#include -#include + +@class NSFont; + +typedef enum _NSButtonType { + NSMomentaryPushButton, + NSPushOnPushOffButton, + NSToggleButton, + NSSwitchButton, + NSRadioButton, + NSMomentaryChangeButton, + NSOnOffButton, + NSMomentaryLight +} NSButtonType; @interface NSButtonCell : NSActionCell - { // Attributes - NSString *alt_contents; - NSImage *alt_image; + NSString *altContents; + NSImage *altImage; + NSString* keyEquivalent; + NSFont* keyEquivalentFont; + unsigned int keyEquivalentModifierMask; BOOL transparent; + unsigned int highlightsByMask; + unsigned int showAltStateMask; // Reserved for back-end use void *be_bc_reserved; @@ -88,7 +100,6 @@ // // Modifying Graphic Attributes // -- (BOOL)isOpaque; - (BOOL)isTransparent; - (void)setTransparent:(BOOL)flag; @@ -98,7 +109,7 @@ - (int)highlightsBy; - (void)setHighlightsBy:(int)aType; - (void)setShowsStateBy:(int)aType; -- (void)setType:(NSButtonType)aType; +- (void)setButtonType:(NSButtonType)aType; - (int)showsStateBy; // diff --git a/Headers/gnustep/gui/NSCStringText.h b/Headers/gnustep/gui/NSCStringText.h index 84473ac8c..abe9cb247 100644 --- a/Headers/gnustep/gui/NSCStringText.h +++ b/Headers/gnustep/gui/NSCStringText.h @@ -28,13 +28,275 @@ #ifndef _GNUstep_H_NSCStringText #define _GNUstep_H_NSCStringText -#include #include -#include +#include @class NSCell; @class NSPasteBoard; +typedef short NSLineDesc; + +typedef struct _NSTextChunk { + short growby; + int allocated; + int used; +} NSTextChunk; + +typedef struct _NSBreakArray { + NSTextChunk chunk; + NSLineDesc breaks[1]; +} NSBreakArray; + +typedef struct _NSCharArray { + NSTextChunk chunk; + unsigned char text[1]; +} NSCharArray; + +typedef unsigned short (*NSCharFilterFunc) (unsigned short charCode, + int flags, + NSStringEncoding theEncoding); + +typedef struct _NSFSM { + const struct _NSFSM *next; + short delta; + short token; +} NSFSM; + +typedef struct _NSHeightInfo { + float newHeight; + float oldHeight; + NSLineDesc lineDesc; +} NSHeightInfo; + +typedef struct _NSHeightChange { + NSLineDesc lineDesc; + NSHeightInfo heightInfo; +} NSHeightChange; + +typedef struct { + unsigned int underline:1; + unsigned int dummy:1; + unsigned int subclassWantsRTF:1; + unsigned int graphic:1; + unsigned int forcedSymbol:1; + unsigned int RESERVED:11; +} NSRunFlags; + +typedef struct _NSRun { + id font; + int chars; + void *paraStyle; + int textRGBColor; + unsigned char superscript; + unsigned char subscript; + id info; + NSRunFlags rFlags; +} NSRun; + +typedef struct { + unsigned int mustMove:1; + unsigned int isMoveChar:1; + unsigned int RESERVED:14; +} NSLayFlags; + +typedef struct _NSLay { + float x; + float y; + short offset; + short chars; + id font; + void *paraStyle; + NSRun *run; + NSLayFlags lFlags; +} NSLay; + +typedef struct _NSLayArray { + NSTextChunk chunk; + NSLay lays[1]; +} NSLayArray; + +typedef struct _NSWidthArray { + NSTextChunk chunk; + float widths[1]; +} NSWidthArray; + +typedef struct _NSTextBlock { + struct _NSTextBlock *next; + struct _NSTextBlock *prior; + struct _tbFlags { + unsigned int malloced:1; + unsigned int PAD:15; + } tbFlags; + short chars; + unsigned char *text; +} NSTextBlock; + +typedef struct _NSTextCache { + int curPos; + NSRun *curRun; + int runFirstPos; + NSTextBlock *curBlock; + int blockFirstPos; +} NSTextCache; + +typedef struct _NSLayInfo { + NSRect rect; + float descent; + float width; + float left; + float right; + float rightIndent; + NSLayArray *lays; + NSWidthArray *widths; + NSCharArray *chars; + NSTextCache cache; + NSRect *textClipRect; + struct _lFlags { + unsigned int horizCanGrow:1; + unsigned int vertCanGrow:1; + unsigned int erase:1; + unsigned int ping:1; + unsigned int endsParagraph:1; + unsigned int resetCache:1; + unsigned int RESERVED:10; + } lFlags; +} NSLayInfo; + +typedef enum _NSParagraphProperty { + NSLeftAlignedParagraph, + NSRightAlignedParagraph, + NSCenterAlignedParagraph, + NSJustificationAlignedParagraph, + NSFirstIndentParagraph, + NSIndentParagraph, + NSAddTabParagraph, + NSRemoveTabParagraph, + NSLeftMarginParagraph, + NSRightMarginParagraph +} NSParagraphProperty; + +typedef struct _NSRunArray { + NSTextChunk chunk; + NSRun runs[1]; +} NSRunArray; + +typedef struct _NSSelPt { + int cp; + int line; + float x; + float y; + int c1st; + float ht; +} NSSelPt; + +typedef struct _NSTabStop { + short kind; + float x; +} NSTabStop; + +typedef char *(*NSTextFilterFunc) (id self, + unsigned char * insertText, + int *insertLength, + int position); + +typedef int (*NSTextFunc) (id self, + NSLayInfo *layInfo); + +typedef struct _NSTextStyle { + float indent1st; + float indent2nd; + float lineHt; + float descentLine; + NSTextAlignment alignment; + short numTabs; + NSTabStop *tabs; +} NSTextStyle; + +enum { + NSLeftTab +}; + +enum { + NSBackspaceKey = 8, + NSCarriageReturnKey = 13, + NSDeleteKey= 0x7f, + NSBacktabKey = 25 +}; + +enum { + NSTextBlockSize = 512 +}; + +// +// NSCStringText Internal State Structure +// +typedef struct _NSCStringTextInternalState { + const NSFSM *breakTable; + const NSFSM *clickTable; + const unsigned char *preSelSmartTable; + const unsigned char *postSelSmartTable; + const unsigned char *charCategoryTable; + char delegateMethods; + NSCharFilterFunc charFilterFunc; + NSTextFilterFunc textFilterFunc; + NSString *_string; + NSTextFunc scanFunc; + NSTextFunc drawFunc; + id delegate; + int tag; + void *cursorTE; + NSTextBlock *firstTextBlock; + NSTextBlock *lastTextBlock; + NSRunArray *theRuns; + NSRun typingRun; + NSBreakArray *theBreaks; + int growLine; + int textLength; + float maxY; + float maxX; + NSRect bodyRect; + float borderWidth; + char clickCount; + NSSelPt sp0; + NSSelPt spN; + NSSelPt anchorL; + NSSelPt anchorR; + NSSize maxSize; + NSSize minSize; + struct _tFlags { +#ifdef __BIG_ENDIAN__ + unsigned int _editMode:2; + unsigned int _selectMode:2; + unsigned int _caretState:2; + unsigned int changeState:1; + unsigned int charWrap:1; + unsigned int haveDown:1; + unsigned int anchorIs0:1; + unsigned int horizResizable:1; + unsigned int vertResizable:1; + unsigned int overstrikeDiacriticals:1; + unsigned int monoFont:1; + unsigned int disableFontPanel:1; + unsigned int inClipView:1; +#else + unsigned int inClipView:1; + unsigned int disableFontPanel:1; + unsigned int monoFont:1; + unsigned int overstrikeDiacriticals:1; + unsigned int vertResizable:1; + unsigned int horizResizable:1; + unsigned int anchorIs0:1; + unsigned int haveDown:1; + unsigned int charWrap:1; + unsigned int changeState:1; + unsigned int _caretState:2; + unsigned int _selectMode:2; + unsigned int _editMode:2; +#endif + } tFlags; + void *_info; + void *_textStr; +} NSCStringTextInternalState; @interface NSCStringText : NSText @@ -294,4 +556,93 @@ @end +// +// Break Tables +// +extern const NSFSM *NSCBreakTable; +extern int NSCBreakTableSize; +extern const NSFSM *NSEnglishBreakTable; +extern int NSEnglishBreakTableSize; +extern const NSFSM *NSEnglishNoBreakTable; +extern int NSEnglishNoBreakTableSize; + +// +// Character Category Tables +// +extern const unsigned char *NSCCharCatTable; +extern const unsigned char *NSEnglishCharCatTable; + +// +// Click Tables +// +extern const NSFSM *NSCClickTable; +extern int NSCClickTableSize; +extern const NSFSM *NSEnglishClickTable; +extern int NSEnglishClickTableSize; + +// +// Smart Cut and Paste Tables +// +extern const unsigned char *NSCSmartLeftChars; +extern const unsigned char *NSCSmartRightChars; +extern const unsigned char *NSEnglishSmartLeftChars; +extern const unsigned char *NSEnglishSmartRightChars; + +// +// Calculate or Draw a Line of Text (in Text Object) +// +int NSDrawALine(id self, NSLayInfo *layInfo); +int NSScanALine(id self, NSLayInfo *layInfo); + +// +// Calculate Font Ascender, Descender, and Line Height (in Text Object) +// +void NSTextFontInfo(id fid, + float *ascender, float *descender, + float *lineHeight); + +// +// Access Text Object's Word Tables +// +NSData * NSDataWithWordTable(const unsigned char *smartLeft, + const unsigned char *smartRight, + const unsigned char *charClasses, + const NSFSM *wrapBreaks, + int wrapBreaksCount, + const NSFSM *clickBreaks, + int clickBreaksCount, + BOOL charWrap); +void NSReadWordTable(NSZone *zone, + NSData *data, + unsigned char **smartLeft, + unsigned char **smartRight, + unsigned char **charClasses, + NSFSM **wrapBreaks, + int *wrapBreaksCount, + NSFSM **clickBreaks, + int *clickBreaksCount, + BOOL *charWrap); + +// +// Array Allocation Functions for Use by the NSText Class +// +NSTextChunk *NSChunkCopy(NSTextChunk *pc, NSTextChunk *dpc); +NSTextChunk *NSChunkGrow(NSTextChunk *pc, int newUsed); +NSTextChunk *NSChunkMalloc(int growBy, int initUsed); +NSTextChunk *NSChunkRealloc(NSTextChunk *pc); +NSTextChunk *NSChunkZoneCopy(NSTextChunk *pc, + NSTextChunk *dpc, + NSZone *zone); +NSTextChunk *NSChunkZoneGrow(NSTextChunk *pc, int newUsed, NSZone *zone); +NSTextChunk *NSChunkZoneMalloc(int growBy, int initUsed, NSZone *zone); +NSTextChunk *NSChunkZoneRealloc(NSTextChunk *pc, NSZone *zone); + +// +// Filter Characters Entered into a Text Object +// +unsigned short NSEditorFilter(unsigned short theChar, + int flags, NSStringEncoding theEncoding); +unsigned short NSFieldFilter(unsigned short theChar, + int flags, NSStringEncoding theEncoding); + #endif // _GNUstep_H_NSCStringText diff --git a/Headers/gnustep/gui/NSCachedImageRep.h b/Headers/gnustep/gui/NSCachedImageRep.h index 4da9cbcb6..8fcb35091 100644 --- a/Headers/gnustep/gui/NSCachedImageRep.h +++ b/Headers/gnustep/gui/NSCachedImageRep.h @@ -29,13 +29,12 @@ #ifndef _GNUstep_H_NSCachedImageRep #define _GNUstep_H_NSCachedImageRep -#include #include -#include -#include +#include + +@class NSWindow; @interface NSCachedImageRep : NSImageRep - { // Attributes NSRect _rect; diff --git a/Headers/gnustep/gui/NSCell.h b/Headers/gnustep/gui/NSCell.h index 3f681fd21..bf769f201 100644 --- a/Headers/gnustep/gui/NSCell.h +++ b/Headers/gnustep/gui/NSCell.h @@ -29,16 +29,71 @@ #ifndef _GNUstep_H_NSCell #define _GNUstep_H_NSCell -#include -#include -#include -#include -#include -#include #include +#include + +#include + +@class NSString; +@class NSView; +@class NSFont; +@class NSText; + +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 +} NSCellAttribute; + +enum { + NSNoCellMask = 0, + NSContentsCellMask = 1, + NSPushInCellMask = 2, + NSChangeGrayCellMask = 4, + NSChangeBackgroundCellMask = 8 +}; @interface NSCell : NSObject - { // Attributes NSString *contents; @@ -56,7 +111,7 @@ BOOL cell_float_autorange; unsigned int cell_float_left; unsigned int cell_float_right; - unsigned int image_position; + NSCellImagePosition image_position; int cell_type; NSTextAlignment text_align; int entry_type; diff --git a/Headers/gnustep/gui/NSClipView.h b/Headers/gnustep/gui/NSClipView.h index 53f466351..48433c9d0 100644 --- a/Headers/gnustep/gui/NSClipView.h +++ b/Headers/gnustep/gui/NSClipView.h @@ -29,15 +29,15 @@ #ifndef _GNUstep_H_NSClipView #define _GNUstep_H_NSClipView -#include #include -#include -#include -#include -#include + +@class NSNotification; + +@class NSCursor; +@class NSEvent; +@class NSColor; @interface NSClipView : NSView - { // Attributes } diff --git a/Headers/gnustep/gui/NSColor.h b/Headers/gnustep/gui/NSColor.h index f1ae36754..7272ef6d6 100644 --- a/Headers/gnustep/gui/NSColor.h +++ b/Headers/gnustep/gui/NSColor.h @@ -29,9 +29,11 @@ #ifndef _GNUstep_H_NSColor #define _GNUstep_H_NSColor -#include #include +@class NSString; +@class NSDictionary; + @class NSPasteboard; // What component should we take values from @@ -40,8 +42,28 @@ #define GNUSTEP_GUI_HSB_ACTIVE 3 #define GNUSTEP_GUI_WHITE_ACTIVE 4 -@interface NSColor : NSObject +enum { + NSGrayModeColorPanel, + NSRGBModeColorPanel, + NSCMYKModeColorPanel, + NSHSBModeColorPanel, + NSCustomPaletteModeColorPanel, + NSColorListModeColorPanel, + NSWheelModeColorPanel +}; +enum { + NSColorPanelGrayModeMask, + NSColorPanelRGBModeMask, + NSColorPanelCMYKModeMask, + NSColorPanelHSBModeMask, + NSColorPanelCustomPaletteModeMask, + NSColorPanelColorListModeMask, + NSColorPanelWheelModeMask, + NSColorPanelAllModesMask +}; + +@interface NSColor : NSObject { // Attributes NSString *colorspace_name; diff --git a/Headers/gnustep/gui/NSColorList.h b/Headers/gnustep/gui/NSColorList.h index 6119abe1b..8f133229a 100644 --- a/Headers/gnustep/gui/NSColorList.h +++ b/Headers/gnustep/gui/NSColorList.h @@ -29,12 +29,15 @@ #ifndef _GNUstep_H_NSColorList #define _GNUstep_H_NSColorList -#include -#include #include -#include -#include -#include + +@class NSString; +@class NSArray; +@class NSMutableArray; +@class NSDictionary; +@class NSMutableDictionary; + +@class NSColor; @interface NSColorList : NSObject @@ -96,4 +99,7 @@ @end +/* Notifications */ +extern NSString *NSColorListChangedNotification; + #endif // _GNUstep_H_NSColorList diff --git a/Headers/gnustep/gui/NSColorPanel.h b/Headers/gnustep/gui/NSColorPanel.h index dbd51141a..580b747e7 100644 --- a/Headers/gnustep/gui/NSColorPanel.h +++ b/Headers/gnustep/gui/NSColorPanel.h @@ -29,14 +29,13 @@ #ifndef _GNUstep_H_NSColorPanel #define _GNUstep_H_NSColorPanel -#include #include -#include -#include -#include + +@class NSView; +@class NSColorList; +@class NSEvent; @interface NSColorPanel : NSPanel - { // Attributes } @@ -74,7 +73,7 @@ // + (BOOL)dragColor:(NSColor **)aColor withEvent:(NSEvent *)anEvent -fromView:(NSView *)sourceView; + fromView:(NSView *)sourceView; - (float)alpha; - (NSColor *)color; - (void)setColor:(NSColor *)aColor; @@ -87,4 +86,7 @@ fromView:(NSView *)sourceView; @end +/* Notifications */ +extern NSString *NSColorPanelColorChangedNotification; + #endif // _GNUstep_H_NSColorPanel diff --git a/Headers/gnustep/gui/NSColorPicker.h b/Headers/gnustep/gui/NSColorPicker.h index b5156a605..8be30ddb5 100644 --- a/Headers/gnustep/gui/NSColorPicker.h +++ b/Headers/gnustep/gui/NSColorPicker.h @@ -29,15 +29,15 @@ #ifndef _GNUstep_H_NSColorPicker #define _GNUstep_H_NSColorPicker -#include -#include -#include -#include -#include +#include #include -@interface NSColorPicker : NSObject +@class NSColorPanel; +@class NSColorList; +@class NSImage; +@class NSButtonCell; +@interface NSColorPicker : NSObject { // Attributes } diff --git a/Headers/gnustep/gui/NSColorPicking.h b/Headers/gnustep/gui/NSColorPicking.h index e211e9616..67008ca11 100644 --- a/Headers/gnustep/gui/NSColorPicking.h +++ b/Headers/gnustep/gui/NSColorPicking.h @@ -28,10 +28,11 @@ #ifndef _GNUstep_H_NSColorPicking #define _GNUstep_H_NSColorPicking -#include +#include @class NSColor; @class NSColorPanel; +@class NSView; @class NSImage; @class NSButtonCell; @class NSColorList; diff --git a/Headers/gnustep/gui/NSColorPrivate.h b/Headers/gnustep/gui/NSColorPrivate.h index 34b1a168d..6a3811481 100644 --- a/Headers/gnustep/gui/NSColorPrivate.h +++ b/Headers/gnustep/gui/NSColorPrivate.h @@ -29,7 +29,7 @@ #ifndef _GNUstep_H_NSColorPrivate #define _GNUstep_H_NSColorPrivate -#include +#include @interface NSColor (GNUstepPrivate) diff --git a/Headers/gnustep/gui/NSColorWell.h b/Headers/gnustep/gui/NSColorWell.h index fe4068988..88c4a8c55 100644 --- a/Headers/gnustep/gui/NSColorWell.h +++ b/Headers/gnustep/gui/NSColorWell.h @@ -29,10 +29,9 @@ #ifndef _GNUstep_H_NSColorWell #define _GNUstep_H_NSColorWell -#include #include -#include -#include + +@class NSColor; @interface NSColorWell : NSControl @@ -41,9 +40,6 @@ NSColor *the_color; BOOL is_active; BOOL is_bordered; - - // Reserved for back-end use - void *be_cwell_reserved; } // @@ -79,13 +75,4 @@ @end -// -// GNUstep backend methods -// -@interface NSColorWell (GNUstepBackend) - -- (void)drawBorderRect:(NSRect)aRect; - -@end - #endif // _GNUstep_H_NSColorWell diff --git a/Headers/gnustep/gui/NSControl.h b/Headers/gnustep/gui/NSControl.h index 195c242ac..d37121706 100644 --- a/Headers/gnustep/gui/NSControl.h +++ b/Headers/gnustep/gui/NSControl.h @@ -29,14 +29,16 @@ #ifndef _GNUstep_H_NSControl #define _GNUstep_H_NSControl -#include -#include -#include -#include -#include +#include + +@class NSString; +@class NSNotification; + +@class NSCell; +@class NSFont; +@class NSEvent; @interface NSControl : NSView - { // Attributes int tag; @@ -98,7 +100,7 @@ - (void)setFont:(NSFont *)fontObject; - (void)setFloatingPointFormat:(BOOL)autoRange left:(unsigned)leftDigits -right:(unsigned)rightDigits; + right:(unsigned)rightDigits; // // Managing the Field Editor @@ -152,9 +154,9 @@ right:(unsigned)rightDigits; // Methods Implemented by the Delegate // - (BOOL)control:(NSControl *)control -textShouldBeginEditing:(NSText *)fieldEditor; + textShouldBeginEditing:(NSText *)fieldEditor; - (BOOL)control:(NSControl *)control -textShouldEndEditing:(NSText *)fieldEditor; + textShouldEndEditing:(NSText *)fieldEditor; - (void)controlTextDidBeginEditing:(NSNotification *)aNotification; - (void)controlTextDidEndEditing:(NSNotification *)aNotification; - (void)controlTextDidChange:(NSNotification *)aNotification; @@ -167,4 +169,8 @@ textShouldEndEditing:(NSText *)fieldEditor; @end +extern NSString *NSControlTextDidBeginEditingNotification; +extern NSString *NSControlTextDidEndEditingNotification; +extern NSString *NSControlTextDidChangeNotification; + #endif // _GNUstep_H_NSControl diff --git a/Headers/gnustep/gui/NSCursor.h b/Headers/gnustep/gui/NSCursor.h index a69a2a1af..5acf3cba7 100644 --- a/Headers/gnustep/gui/NSCursor.h +++ b/Headers/gnustep/gui/NSCursor.h @@ -29,11 +29,11 @@ #ifndef _GNUstep_H_NSCursor #define _GNUstep_H_NSCursor -#include -#include -#include #include +@class NSImage; +@class NSEvent; + @interface NSCursor : NSObject { diff --git a/Headers/gnustep/gui/NSCustomImageRep.h b/Headers/gnustep/gui/NSCustomImageRep.h index 3f60fcf9a..ff116fb73 100644 --- a/Headers/gnustep/gui/NSCustomImageRep.h +++ b/Headers/gnustep/gui/NSCustomImageRep.h @@ -29,12 +29,9 @@ #ifndef _GNUstep_H_NSCustomImageRep #define _GNUstep_H_NSCustomImageRep -#include #include -#include @interface NSCustomImageRep : NSImageRep - { // Attributes id delegate; diff --git a/Headers/gnustep/gui/NSDataLink.h b/Headers/gnustep/gui/NSDataLink.h index 75dde4122..5063de37f 100644 --- a/Headers/gnustep/gui/NSDataLink.h +++ b/Headers/gnustep/gui/NSDataLink.h @@ -29,16 +29,34 @@ #ifndef _GNUstep_H_NSDataLink #define _GNUstep_H_NSDataLink -#include -#include -#include -#include #include +@class NSString; +@class NSArray; +@class NSDate; + @class NSDataLinkManager; +@class NSSelection; +@class NSPasteboard; + +typedef int NSDataLinkNumber; + +typedef enum _NSDataLinkDisposition { + NSLinkInDestination, + NSLinkInSource, + NSLinkBroken +} NSDataLinkDisposition; + +typedef enum _NSDataLinkUpdateMode { + NSUpdateContinuously, + NSUpdateWhenSourceSaved, + NSUpdateManually, + NSUpdateNever +} NSDataLinkUpdateMode; + +extern NSString *NSDataLinkFileNameExtension; @interface NSDataLink : NSObject - { // Attributes } @@ -49,7 +67,7 @@ - (id)initLinkedToFile:(NSString *)filename; - (id)initLinkedToSourceSelection:(NSSelection *)selection managedBy:(NSDataLinkManager *)linkManager -supportingTypes:(NSArray *)newTypes; + supportingTypes:(NSArray *)newTypes; - (id)initWithContentsOfFile:(NSString *)filename; - (id)initWithPasteboard:(NSPasteboard *)pasteboard; diff --git a/Headers/gnustep/gui/NSDataLinkManager.h b/Headers/gnustep/gui/NSDataLinkManager.h index e95658a44..93ad0f7e5 100644 --- a/Headers/gnustep/gui/NSDataLinkManager.h +++ b/Headers/gnustep/gui/NSDataLinkManager.h @@ -29,14 +29,17 @@ #ifndef _GNUstep_H_NSDataLinkManager #define _GNUstep_H_NSDataLinkManager -#include -#include -#include -#include #include -@interface NSDataLinkManager : NSObject +@class NSString; +@class NSEnumerator; +@class NSDataLink; +@class NSSelection; +@class NSPasteboard; +@class NSWindow; + +@interface NSDataLinkManager : NSObject { // Attributes } @@ -57,7 +60,7 @@ at:(NSSelection *)selection; - (NSDataLink *)addLinkPreviouslyAt:(NSSelection *)oldSelection fromPasteboard:(NSPasteboard *)pasteboard -at:(NSSelection *)selection; + at:(NSSelection *)selection; - (void)breakAllLinks; - (void)writeLinksToPasteboard:(NSPasteboard *)pasteboard; @@ -96,7 +99,7 @@ at:(NSSelection *)selection; // - (BOOL)copyToPasteboard:(NSPasteboard *)pasteboard at:(NSSelection *)selection -cheapCopyAllowed:(BOOL)flag; + cheapCopyAllowed:(BOOL)flag; - (void)dataLinkManager:(NSDataLinkManager *)sender didBreakLink:(NSDataLink *)link; - (BOOL)dataLinkManager:(NSDataLinkManager *)sender @@ -124,4 +127,10 @@ cheapCopyAllowed:(BOOL)flag; @end +// +// Draw a Distinctive Outline around Linked Data +// +void NSFrameLinkRect(NSRect aRect, BOOL isDestination); +float NSLinkFrameThickness(void); + #endif // _GNUstep_H_NSDataLinkManager diff --git a/Headers/gnustep/gui/NSDataLinkPanel.h b/Headers/gnustep/gui/NSDataLinkPanel.h index c307a6f22..b3ea64c05 100644 --- a/Headers/gnustep/gui/NSDataLinkPanel.h +++ b/Headers/gnustep/gui/NSDataLinkPanel.h @@ -29,15 +29,13 @@ #ifndef _GNUstep_H_NSDataLinkPanel #define _GNUstep_H_NSDataLinkPanel -#include #include -#include -#include -#include +@class NSDataLink; +@class NSDataLinkManager; +@class NSView; @interface NSDataLinkPanel : NSPanel - { // Attributes } @@ -52,16 +50,16 @@ // + (void)getLink:(NSDataLink **)link manager:(NSDataLinkManager **)linkManager -isMultiple:(BOOL *)flag; + isMultiple:(BOOL *)flag; + (void)setLink:(NSDataLink *)link manager:(NSDataLinkManager *)linkManager -isMultiple:(BOOL)flag; + isMultiple:(BOOL)flag; - (void)getLink:(NSDataLink **)link manager:(NSDataLinkManager **)linkManager -isMultiple:(BOOL *)flag; + isMultiple:(BOOL *)flag; - (void)setLink:(NSDataLink *)link manager:(NSDataLinkManager *)linkManager -isMultiple:(BOOL)flag; + isMultiple:(BOOL)flag; // // Customizing the Panel diff --git a/Headers/gnustep/gui/NSDragging.h b/Headers/gnustep/gui/NSDragging.h index 7e952dcbc..6647c96d6 100644 --- a/Headers/gnustep/gui/NSDragging.h +++ b/Headers/gnustep/gui/NSDragging.h @@ -28,12 +28,22 @@ #ifndef _GNUstep_H_NSDragging #define _GNUstep_H_NSDragging -#include +#include +#include @class NSWindow; -@class NSPasteBoard; +@class NSPasteboard; @class NSImage; +typedef enum _NSDragOperation { + NSDragOperationNone, + NSDragOperationCopy, + NSDragOperationLink, + NSDragOperationGeneric, + NSDragOperationPrivate, + NSDragOperationAll +} NSDragOperation; + @protocol NSDraggingInfo // diff --git a/Headers/gnustep/gui/NSEPSImageRep.h b/Headers/gnustep/gui/NSEPSImageRep.h index f3a5f6afe..9eddb41fd 100644 --- a/Headers/gnustep/gui/NSEPSImageRep.h +++ b/Headers/gnustep/gui/NSEPSImageRep.h @@ -29,12 +29,11 @@ #ifndef _GNUstep_H_NSEPSImageRep #define _GNUstep_H_NSEPSImageRep -#include #include -#include + +@class NSData; @interface NSEPSImageRep : NSImageRep - { // Attributes } diff --git a/Headers/gnustep/gui/NSEvent.h b/Headers/gnustep/gui/NSEvent.h index 3847796c8..d99697be6 100644 --- a/Headers/gnustep/gui/NSEvent.h +++ b/Headers/gnustep/gui/NSEvent.h @@ -29,17 +29,62 @@ #ifndef _GNUstep_H_NSEvent #define _GNUstep_H_NSEvent -#include -#include -#include -#include #include -#include +#include + +@class NSString; @class NSWindow; +@class NSDPSContext; + +typedef enum _NSEventType { + NSLeftMouseDown, + NSLeftMouseUp, + NSRightMouseDown, + NSRightMouseUp, + NSMouseMoved, + NSLeftMouseDragged, + NSRightMouseDragged, + NSMouseEntered, + NSMouseExited, + NSKeyDown, + NSKeyUp, + NSFlagsChanged, + NSPeriodic, + NSCursorUpdate +} NSEventType; + +enum { + NSLeftMouseDownMask = 1, + NSLeftMouseUpMask = 2, + NSRightMouseDownMask = 4, + NSRightMouseUpMask = 8, + NSMouseMovedMask = 16, + NSLeftMouseDraggedMask = 32, + NSRightMouseDraggedMask = 64, + NSMouseEnteredMask = 128, + NSMouseExitedMask = 256, + NSKeyDownMask = 512, + NSKeyUpMask = 1024, + NSFlagsChangedMask = 2048, + NSPeriodicMask = 4096, + NSCursorUpdateMask = 8192, +// Note that NSAnyEventMask is an OR-combination of all other event masks + NSAnyEventMask = 16383 +}; + +enum { + NSAlphaShiftKeyMask = 1, + NSShiftKeyMask = 2, + NSControlKeyMask = 4, + NSAlternateKeyMask = 8, + NSCommandKeyMask = 16, + NSNumericPadKeyMask = 32, + NSHelpKeyMask = 64, + NSFunctionKeyMask = 128 +}; @interface NSEvent : NSObject - { // Attributes NSEventType event_type; @@ -177,4 +222,85 @@ @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); + + #endif // _GNUstep_H_NSEvent diff --git a/Headers/gnustep/gui/NSFont.h b/Headers/gnustep/gui/NSFont.h index 174b8334f..a5ca845d0 100644 --- a/Headers/gnustep/gui/NSFont.h +++ b/Headers/gnustep/gui/NSFont.h @@ -6,7 +6,8 @@ Copyright (C) 1996 Free Software Foundation, Inc. Author: Scott Christley - Date: 1996 + Author: Ovidiu Predescu + Date: 1996, 1997 This file is part of the GNUstep GUI Library. @@ -29,19 +30,26 @@ #ifndef _GNUstep_H_NSFont #define _GNUstep_H_NSFont -#include #include +#include + +@class NSString; +@class NSDictionary; + +typedef unsigned int NSGlyph; + +enum { + NSControlGlyph = 0x00ffffff, + NSNullGlyph = 0x0 +}; + +extern const float *NSFontIdentityMatrix; @interface NSFont : NSObject - { - // Attributes - NSString *family_name; - NSString *font_name; - NSString *type_face; - float point_size; - NSFontTraitMask font_traits; - int font_weight; + // Font attributes + NSString *fontName; + float matrix[6]; // Reserved for back-end use void *be_font_reserved; @@ -76,11 +84,21 @@ - (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; +- (float)underlinePosition; +- (float)underlineThickness; +- (float)xHeight; - (float)widthOfString:(NSString *)string; - (float *)widths; @@ -90,6 +108,7 @@ - (NSSize)advancementForGlyph:(NSGlyph)aGlyph; - (NSRect)boundingRectForGlyph:(NSGlyph)aGlyph; - (BOOL)glyphIsEncoded:(NSGlyph)aGlyph; +- (NSGlyph)glyphWithName:(NSString*)glyphName; - (NSPoint)positionOfGlyph:(NSGlyph)curGlyph precededByGlyph:(NSGlyph)prevGlyph isNominal:(BOOL *)nominal; @@ -102,4 +121,22 @@ @end +extern NSString *NSAFMAscender; +extern NSString *NSAFMCapHeight; +extern NSString *NSAFMCharacterSet; +extern NSString *NSAFMDescender; +extern NSString *NSAFMEncodingScheme; +extern NSString *NSAFMFamilyName; +extern NSString *NSAFMFontName; +extern NSString *NSAFMFormatVersion; +extern NSString *NSAFMFullName; +extern NSString *NSAFMItalicAngle; +extern NSString *NSAFMMappingScheme; +extern NSString *NSAFMNotice; +extern NSString *NSAFMUnderlinePosition; +extern NSString *NSAFMUnderlineThickness; +extern NSString *NSAFMVersion; +extern NSString *NSAFMWeight; +extern NSString *NSAFMXHeight; + #endif // _GNUstep_H_NSFont diff --git a/Headers/gnustep/gui/NSFontManager.h b/Headers/gnustep/gui/NSFontManager.h index 2ac7eda43..9b2c443f2 100644 --- a/Headers/gnustep/gui/NSFontManager.h +++ b/Headers/gnustep/gui/NSFontManager.h @@ -29,21 +29,38 @@ #ifndef _GNUstep_H_NSFontManager #define _GNUstep_H_NSFontManager -#include -#include -#include -#include +#include + +@class NSString; +@class NSArray; + +@class NSFont; +@class NSMenu; +@class NSFontPanel; + +typedef unsigned int NSFontTraitMask; + +enum { + NSItalicFontMask = 1, + NSBoldFontMask = 2, + NSUnboldFontMask = 4, + NSNonStandardCharacterSetFontMask = 8, + NSNarrowFontMask = 16, + NSExpandedFontMask = 32, + NSCondensedFontMask = 64, + NSSmallCapsFontMask = 128, + NSPosterFontMask = 256, + NSCompressedFontMask = 512, + NSUnitalicFontMask = 1024 +}; @interface NSFontManager : NSObject - { // Attributes id delegate; SEL action; - NSMutableArray *family_list; - NSMutableArray *family_metrics; NSFont *selected_font; - NSMutableArray *font_list; + NSArray *fontsList; NSMenu *font_menu; } @@ -80,7 +97,6 @@ // - (SEL)action; - (NSArray *)availableFonts; -- (NSArray *)familyMetrics; - (NSMenu *)fontMenu:(BOOL)create; - (NSFontPanel *)fontPanel:(BOOL)create; - (BOOL)isEnabled; diff --git a/Headers/gnustep/gui/NSFontPanel.h b/Headers/gnustep/gui/NSFontPanel.h index ba7fd419b..73cf16d9d 100644 --- a/Headers/gnustep/gui/NSFontPanel.h +++ b/Headers/gnustep/gui/NSFontPanel.h @@ -29,12 +29,23 @@ #ifndef _GNUstep_H_NSFontPanel #define _GNUstep_H_NSFontPanel -#include +#include #include -#include + +@class NSFont; +@class NSView; + +enum { + NSFPPreviewButton, + NSFPRevertButton, + NSFPSetButton, + NSFPPreviewField, + NSFPSizeField, + NSFPSizeTitle, + NSFPCurrentField +}; @interface NSFontPanel : NSPanel - { // Attributes NSFont *panel_font; diff --git a/Headers/gnustep/gui/NSFontPrivate.h b/Headers/gnustep/gui/NSFontPrivate.h deleted file mode 100644 index 8ce557cfa..000000000 --- a/Headers/gnustep/gui/NSFontPrivate.h +++ /dev/null @@ -1,48 +0,0 @@ -/* - NSFontPrivate.h - - Private methods for the font class. - - Copyright (C) 1996 Free Software Foundation, Inc. - - Author: Scott Christley - Date: September 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_NSFontPrivate -#define _GNUstep_H_NSFontPrivate - -#include - -@interface NSFont (GNUstepPrivate) - -- (void)setFamilyName:(NSString *)familyName; -- (void)setFontName:(NSString *)fontName; -- (void)setPointSize:(float)value; -- (NSFontTraitMask)traits; -- (void)setTraits:(NSFontTraitMask)traits; -- (int)weight; -- (void)setWeight:(int)value; -- (NSString *)typeface; -- (void)setTypeface:(NSString *)str; - -@end - -#endif /* _GNUstep_H_NSFontPrivate */ diff --git a/Headers/gnustep/gui/NSForm.h b/Headers/gnustep/gui/NSForm.h index 02532aa8d..a0b2e83dd 100644 --- a/Headers/gnustep/gui/NSForm.h +++ b/Headers/gnustep/gui/NSForm.h @@ -29,14 +29,12 @@ #ifndef _GNUstep_H_NSForm #define _GNUstep_H_NSForm -#include #include -#include -#include -#include + +@class NSFormCell; +@class NSFont; @interface NSForm : NSMatrix - { // Attributes } diff --git a/Headers/gnustep/gui/NSFormCell.h b/Headers/gnustep/gui/NSFormCell.h index 685db5dd9..0f478a8fe 100644 --- a/Headers/gnustep/gui/NSFormCell.h +++ b/Headers/gnustep/gui/NSFormCell.h @@ -29,12 +29,9 @@ #ifndef _GNUstep_H_NSFormCell #define _GNUstep_H_NSFormCell -#include #include -#include @interface NSFormCell : NSActionCell - { // Attributes } diff --git a/Headers/gnustep/gui/NSGraphics.h b/Headers/gnustep/gui/NSGraphics.h new file mode 100644 index 000000000..d83ab8769 --- /dev/null +++ b/Headers/gnustep/gui/NSGraphics.h @@ -0,0 +1,137 @@ +/* + NSGraphics.h + + Copyright (C) 1996 Free Software Foundation, Inc. + + Author: Ovidiu Predescu + Date: February 1997 + + This file is part of the GNUstep GUI Library. + + This library is free software; you can redistribute it and/or + modify it under the terms of the GNU Library General Public + License as published by the Free Software Foundation; either + version 2 of the License, or (at your option) any later version. + + This library is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + Library General Public License for more details. + + You should have received a copy of the GNU Library General Public + License along with this library; if not, write to the Free + Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. +*/ +#ifndef __NSGraphics_h__ +#define __NSGraphics_h__ + +#include +#include + +@class NSString; +@class NSColor; + +// +// Colorspace Names +// +extern NSString *NSCalibratedWhiteColorSpace; +extern NSString *NSCalibratedBlackColorSpace; +extern NSString *NSCalibratedRGBColorSpace; +extern NSString *NSDeviceWhiteColorSpace; +extern NSString *NSDeviceBlackColorSpace; +extern NSString *NSDeviceRGBColorSpace; +extern NSString *NSDeviceCMYKColorSpace; +extern NSString *NSNamedColorSpace; +extern NSString *NSCustomColorSpace; + +typedef int NSWindowDepth; + +// +// Gray Values +// +extern const float NSBlack; +extern const float NSDarkGray; +extern const float NSWhite; +extern const float NSLightGray; + +// +// Device Dictionary Keys +// +extern NSString *NSDeviceResolution; +extern NSString *NSDeviceColorSpaceName; +extern NSString *NSDeviceBitsPerSample; +extern NSString *NSDeviceIsScreen; +extern NSString *NSDeviceIsPrinter; +extern NSString *NSDeviceSize; + +// +// Rectangle Drawing Functions +// +void NSEraseRect(NSRect aRect); +void NSHighlightRect(NSRect aRect); +void NSRectClip(NSRect aRect); +void NSRectClipList(const NSRect *rects, int count); +void NSRectFill(NSRect aRect); +void NSRectFillList(const NSRect *rects, int count); +void NSRectFillListWithGrays(const NSRect *rects, + const float *grays, int count); + +// +// Draw a Bordered Rectangle +// +void NSDrawButton(NSRect aRect, NSRect clipRect); +void NSDrawGrayBezel(NSRect aRect, NSRect clipRect); +void NSDrawGroove(NSRect aRect, NSRect clipRect); +NSRect NSDrawTiledRects(NSRect boundsRect, NSRect clipRect, + const NSRectEdge *sides, const float *grays, + int count); +void NSDrawWhiteBezel(NSRect aRect, NSRect clipRect); +void NSFrameRect(NSRect aRect); +void NSFrameRectWithWidth(NSRect aRect, float frameWidth); + +// +// Get Information About Color Space and Window Depth +// +const NSWindowDepth *NSAvailableWindowDepths(void); +NSWindowDepth NSBestDepth(NSString *colorSpace, + int bitsPerSample, int bitsPerPixel, + BOOL planar, BOOL *exactMatch); +int NSBitsPerPixelFromDepth(NSWindowDepth depth); +int NSBitsPerSampleFromDepth(NSWindowDepth depth); +NSString *NSColorSpaceFromDepth(NSWindowDepth depth); +int NSNumberOfColorComponents(NSString *colorSpaceName); +BOOL NSPlanarFromDepth(NSWindowDepth depth); + +// +// Read the Color at a Screen Position +// +NSColor *NSReadPixel(NSPoint location); + +// +// Copy an image +// +void NSCopyBitmapFromGState(int srcGstate, NSRect srcRect, NSRect destRect); +void NSCopyBits(int srcGstate, NSRect srcRect, NSPoint destPoint); + +// +// Render Bitmap Images +// +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]); + +// +// Play the System Beep +// +void NSBeep(void); + + +#endif /* __NSGraphics_h__ */ diff --git a/Headers/gnustep/gui/NSHelpPanel.h b/Headers/gnustep/gui/NSHelpPanel.h index a627ad37a..46d14299b 100644 --- a/Headers/gnustep/gui/NSHelpPanel.h +++ b/Headers/gnustep/gui/NSHelpPanel.h @@ -29,13 +29,11 @@ #ifndef _GNUstep_H_NSHelpPanel #define _GNUstep_H_NSHelpPanel -#include #include -#include -#include + +@class NSString; @interface NSHelpPanel : NSPanel - { // Attributes } @@ -60,7 +58,7 @@ // + (void)attachHelpFile:(NSString *)filename markerName:(NSString *)markerName -to:(id)anObject; + to:(id)anObject; + (void)detachHelpFrom:(id)anObject; // diff --git a/Headers/gnustep/gui/NSImage.h b/Headers/gnustep/gui/NSImage.h index d393e61e3..20a9570a4 100644 --- a/Headers/gnustep/gui/NSImage.h +++ b/Headers/gnustep/gui/NSImage.h @@ -29,12 +29,16 @@ #ifndef _GNUstep_H_NSImage #define _GNUstep_H_NSImage -#include #include -#include +#include +#include +#include + +@class NSString; +@class NSMutableArray; +@class NSData; @class NSPasteboard; -@class NSMutableArray; @class NSImageRep; @class NSColor; @class NSView; @@ -195,4 +199,11 @@ @end + +@interface NSBundle (NSImageAdditions) + +- (NSString *)pathForImageResource:(NSString *)name; + +@end + #endif // _GNUstep_H_NSImage diff --git a/Headers/gnustep/gui/NSImageRep.h b/Headers/gnustep/gui/NSImageRep.h index 285d0a033..952ac3baf 100644 --- a/Headers/gnustep/gui/NSImageRep.h +++ b/Headers/gnustep/gui/NSImageRep.h @@ -29,12 +29,20 @@ #ifndef _GNUstep_H_NSImageRep #define _GNUstep_H_NSImageRep -#include -#include #include +#include + +@class NSString; +@class NSArray; +@class NSData; + +@class NSPasteboard; + +enum { + NSImageRepMatchesDevice +}; @interface NSImageRep : NSObject - { // Attributes NSString* _colorSpace; @@ -111,4 +119,6 @@ @end +extern NSString *NSImageRepRegistryChangedNotification; + #endif // _GNUstep_H_NSImageRep diff --git a/Headers/gnustep/gui/NSMatrix.h b/Headers/gnustep/gui/NSMatrix.h index 3ee5890f4..a02a3381d 100644 --- a/Headers/gnustep/gui/NSMatrix.h +++ b/Headers/gnustep/gui/NSMatrix.h @@ -31,13 +31,25 @@ #ifndef _GNUstep_H_NSMatrix #define _GNUstep_H_NSMatrix -#include #include -#include -#include + +@class NSArray; +@class NSMutableArray; +@class NSNotification; + +@class NSCell; +@class NSColor; +@class NSText; +@class NSEvent; + +typedef enum _NSMatrixMode { + NSRadioModeMatrix, + NSHighlightModeMatrix, + NSListModeMatrix, + NSTrackModeMatrix +} NSMatrixMode; @interface NSMatrix : NSControl - { // Attributes NSMutableArray *rows; @@ -241,7 +253,7 @@ column:(int)column; - (void)highlightCell:(BOOL)flag atRow:(int)row -column:(int)column; + column:(int)column; // //Target and Action diff --git a/Headers/gnustep/gui/NSMenu.h b/Headers/gnustep/gui/NSMenu.h index 4b373a4c9..88d3941f4 100644 --- a/Headers/gnustep/gui/NSMenu.h +++ b/Headers/gnustep/gui/NSMenu.h @@ -30,15 +30,17 @@ #ifndef _GNUstep_H_NSMenu #define _GNUstep_H_NSMenu -#include -#include -#include -#include #include -#include +#include + +@class NSString; +@class NSArray; +@class NSMutableArray; + +@class NSMatrix; +@class NSMenuCell; @interface NSMenu : NSObject - { // Attributes NSString *window_title; diff --git a/Headers/gnustep/gui/NSMenuCell.h b/Headers/gnustep/gui/NSMenuCell.h index de4753e98..6ebdef9b0 100644 --- a/Headers/gnustep/gui/NSMenuCell.h +++ b/Headers/gnustep/gui/NSMenuCell.h @@ -29,14 +29,12 @@ #ifndef _GNUstep_H_NSMenuCell #define _GNUstep_H_NSMenuCell -#include #include -#include +@class NSString; @class NSMenu; @interface NSMenuCell : NSButtonCell - { // Attributes NSString *key_equivalent; diff --git a/Headers/gnustep/gui/NSMenuPrivate.h b/Headers/gnustep/gui/NSMenuPrivate.h index c766808a7..cb3012897 100644 --- a/Headers/gnustep/gui/NSMenuPrivate.h +++ b/Headers/gnustep/gui/NSMenuPrivate.h @@ -29,7 +29,7 @@ #ifndef _GNUstep_H_NSMenuPrivate #define _GNUstep_H_NSMenuPrivate -#include +#include @interface NSMenu (GNUstepPrivate) diff --git a/Headers/gnustep/gui/NSNibLoading.h b/Headers/gnustep/gui/NSNibLoading.h index 772848fdc..915a4c960 100644 --- a/Headers/gnustep/gui/NSNibLoading.h +++ b/Headers/gnustep/gui/NSNibLoading.h @@ -28,8 +28,7 @@ #ifndef _GNUstep_H_NSNibLoading #define _GNUstep_H_NSNibLoading -#include -#include +#include @interface NSObject (NSNibAwaking) @@ -40,4 +39,16 @@ @end + +@interface NSBundle (NSNibLoading) + ++ (BOOL)loadNibFile:(NSString *)fileName + externalNameTable:(NSDictionary *)context + withZone:(NSZone *)zone; + ++ (BOOL)loadNibNamed:(NSString *)aNibName + owner:(id)owner; + +@end + #endif // _GNUstep_H_NSNibLoading diff --git a/Headers/gnustep/gui/NSOpenPanel.h b/Headers/gnustep/gui/NSOpenPanel.h index 1cce8fa46..829d76eaf 100644 --- a/Headers/gnustep/gui/NSOpenPanel.h +++ b/Headers/gnustep/gui/NSOpenPanel.h @@ -29,12 +29,13 @@ #ifndef _GNUstep_H_NSOpenPanel #define _GNUstep_H_NSOpenPanel -#include #include -#include + +@class NSString; +@class NSArray; +@class NSMutableArray; @interface NSOpenPanel : NSSavePanel - { // Attributes NSMutableArray *the_filenames; @@ -69,7 +70,7 @@ - (int)runModalForTypes:(NSArray *)fileTypes; - (int)runModalForDirectory:(NSString *)path file:(NSString *)filename -types:(NSArray *)fileTypes; + types:(NSArray *)fileTypes; // // NSCoding protocol diff --git a/Headers/gnustep/gui/NSPageLayout.h b/Headers/gnustep/gui/NSPageLayout.h index 69f1d47ad..4f246ed80 100644 --- a/Headers/gnustep/gui/NSPageLayout.h +++ b/Headers/gnustep/gui/NSPageLayout.h @@ -29,14 +29,24 @@ #ifndef _GNUstep_H_NSPageLayout #define _GNUstep_H_NSPageLayout -#include #include -#include -#include -#include + +@class NSPrintInfo; +@class NSView; + +enum { + NSPLImageButton, + NSPLTitleField, + NSPLPaperNameButton, + NSPLUnitsButton, + NSPLWidthForm, + NSPLHeightForm, + NSPLOrientationMatrix, + NSPLCancelButton, + NSPLOKButton +}; @interface NSPageLayout : NSPanel - { // Attributes } diff --git a/Headers/gnustep/gui/NSPanel.h b/Headers/gnustep/gui/NSPanel.h index e3f076326..390faffed 100644 --- a/Headers/gnustep/gui/NSPanel.h +++ b/Headers/gnustep/gui/NSPanel.h @@ -29,12 +29,23 @@ #ifndef _GNUstep_H_NSPanel #define _GNUstep_H_NSPanel -#include #include -#include + +@class NSString; + +enum { + NSOKButton = 1, + NSCancelButton = 0 +}; + +enum { + NSAlertDefaultReturn = 1, + NSAlertAlternateReturn = 0, + NSAlertOtherReturn = -1, + NSAlertErrorReturn = -2 +}; @interface NSPanel : NSWindow - { // Attributes } @@ -57,4 +68,33 @@ @end +// +// Create an Attention Panel without Running It Yet +// +id NSGetAlertPanel(NSString *title, + NSString *msg, + NSString *defaultButton, + NSString *alternateButton, + NSString *otherButton, ...); + +// +// Create and Run an Attention Panel +// +int NSRunAlertPanel(NSString *title, + NSString *msg, + NSString *defaultButton, + NSString *alternateButton, + NSString *otherButton, ...); +int NSRunLocalizedAlertPanel(NSString *table, + NSString *title, + NSString *msg, + NSString *defaultButton, + NSString *alternateButton, + NSString *otherButton, ...); + +// +// Release an Attention Panel +// +void NSReleaseAlertPanel(id panel); + #endif // _GNUstep_H_NSPanel diff --git a/Headers/gnustep/gui/NSPasteboard.h b/Headers/gnustep/gui/NSPasteboard.h index e57fffd98..7621299ab 100644 --- a/Headers/gnustep/gui/NSPasteboard.h +++ b/Headers/gnustep/gui/NSPasteboard.h @@ -29,10 +29,38 @@ #ifndef _GNUstep_H_NSPasteboard #define _GNUstep_H_NSPasteboard -#include +#include + +@class NSString; +@class NSArray; +@class NSData; + +// +// Pasteboard Type Globals +// +extern NSString *NSStringPboardType; +extern NSString *NSColorPboardType; +extern NSString *NSFileContentsPboardType; +extern NSString *NSFilenamesPboardType; +extern NSString *NSFontPboardType; +extern NSString *NSRulerPboardType; +extern NSString *NSPostScriptPboardType; +extern NSString *NSTabularTextPboardType; +extern NSString *NSRTFPboardType; +extern NSString *NSTIFFPboardType; +extern NSString *NSDataLinkPboardType; +extern NSString *NSGeneralPboardType; + +// +// Pasteboard Name Globals +// +extern NSString *NSDragPboard; +extern NSString *NSFindPboard; +extern NSString *NSFontPboard; +extern NSString *NSGeneralPboard; +extern NSString *NSRulerPboard; @interface NSPasteboard : NSObject - { // Attributes } @@ -94,9 +122,18 @@ // Methods Implemented by the Owner // - (void)pasteboard:(NSPasteboard *)sender -provideDataForType:(NSString *)type; + provideDataForType:(NSString *)type; - (void)pasteboardChangedOwner:(NSPasteboard *)sender; @end +// +// Return File-related Pasteboard Types +// +NSString *NSCreateFileContentsPboardType(NSString *fileType); +NSString *NSCreateFilenamePboardType(NSString *filename); +NSString *NSGetFileType(NSString *pboardType); +NSArray *NSGetFileTypes(NSArray *pboardTypes); + + #endif // _GNUstep_H_NSPasteboard diff --git a/Headers/gnustep/gui/NSPopUpButton.h b/Headers/gnustep/gui/NSPopUpButton.h index bb5b77f51..9a4d37999 100644 --- a/Headers/gnustep/gui/NSPopUpButton.h +++ b/Headers/gnustep/gui/NSPopUpButton.h @@ -29,15 +29,17 @@ #ifndef _GNUstep_H_NSPopUpButton #define _GNUstep_H_NSPopUpButton -#include #include -#include -#include -#include -#include + +@class NSString; +@class NSArray; +@class NSMutableArray; + +@class NSMenuCell; +@class NSFont; +@class NSMatrix; @interface NSPopUpButton : NSButton - { // Attributes NSMutableArray *list_items; diff --git a/Headers/gnustep/gui/NSPrintInfo.h b/Headers/gnustep/gui/NSPrintInfo.h index d35300eaa..3e968e9b0 100644 --- a/Headers/gnustep/gui/NSPrintInfo.h +++ b/Headers/gnustep/gui/NSPrintInfo.h @@ -29,13 +29,27 @@ #ifndef _GNUstep_H_NSPrintInfo #define _GNUstep_H_NSPrintInfo -#include -#include -#include #include +#include + +@class NSString; +@class NSDictionary; +@class NSMutableDictionary; + +@class NSPrinter; + +typedef enum _NSPrintingOrientation { + NSPortraitOrientation, + NSLandscapeOrientation +} NSPrintingOrientation; + +typedef enum _NSPrintingPaginationMode { + NSAutoPagination, + NSFitPagination, + NSClipPagination +} NSPrintingPaginationMode; @interface NSPrintInfo : NSObject - { // Attributes } @@ -114,4 +128,51 @@ @end +// +// Printing Information Dictionary Keys +// +extern NSString *NSPrintAllPages; +extern NSString *NSPrintBottomMargin; +extern NSString *NSPrintCopies; +extern NSString *NSPrintFaxCoverSheetName; +extern NSString *NSPrintFaxHighResolution; +extern NSString *NSPrintFaxModem; +extern NSString *NSPrintFaxReceiverNames; +extern NSString *NSPrintFaxReceiverNumbers; +extern NSString *NSPrintFaxReturnReceipt; +extern NSString *NSPrintFaxSendTime; +extern NSString *NSPrintFaxTrimPageEnds; +extern NSString *NSPrintFaxUseCoverSheet; +extern NSString *NSPrintFirstPage; +extern NSString *NSPrintHorizonalPagination; +extern NSString *NSPrintHorizontallyCentered; +extern NSString *NSPrintJobDisposition; +extern NSString *NSPrintJobFeatures; +extern NSString *NSPrintLastPage; +extern NSString *NSPrintLeftMargin; +extern NSString *NSPrintManualFeed; +extern NSString *NSPrintOrientation; +extern NSString *NSPrintPackageException; +extern NSString *NSPrintPagesPerSheet; +extern NSString *NSPrintPaperFeed; +extern NSString *NSPrintPaperName; +extern NSString *NSPrintPaperSize; +extern NSString *NSPrintPrinter; +extern NSString *NSPrintReversePageOrder; +extern NSString *NSPrintRightMargin; +extern NSString *NSPrintSavePath; +extern NSString *NSPrintScalingFactor; +extern NSString *NSPrintTopMargin; +extern NSString *NSPrintVerticalPagination; +extern NSString *NSPrintVerticallyCentered; + +// +// Print Job Disposition Values +// +extern NSString *NSPrintCancelJob; +extern NSString *NSPrintFaxJob; +extern NSString *NSPrintPreviewJob; +extern NSString *NSPrintSaveJob; +extern NSString *NSPrintSpoolJob; + #endif // _GNUstep_H_NSPrintInfo diff --git a/Headers/gnustep/gui/NSPrintOperation.h b/Headers/gnustep/gui/NSPrintOperation.h index d6236d138..abd581fe5 100644 --- a/Headers/gnustep/gui/NSPrintOperation.h +++ b/Headers/gnustep/gui/NSPrintOperation.h @@ -29,14 +29,26 @@ #ifndef _GNUstep_H_NSPrintOperation #define _GNUstep_H_NSPrintOperation -#include -#include -#include -#include -#include +#include +#include + +@class NSString; +@class NSData; +@class NSMutableData; + +@class NSView; +@class NSPrintInfo; +@class NSPrintPanel; +@class NSDPSContext; + +typedef enum _NSPrintingPageOrder { + NSDescendingPageOrder, + NSSpecialPageOrder, + NSAscendingPageOrder, + NSUnknownPageOrder +} NSPrintingPageOrder; @interface NSPrintOperation : NSObject - { // Attributes } @@ -46,21 +58,21 @@ // + (NSPrintOperation *)EPSOperationWithView:(NSView *)aView insideRect:(NSRect)rect -toData:(NSMutableData *)data; + toData:(NSMutableData *)data; + (NSPrintOperation *)EPSOperationWithView:(NSView *)aView insideRect:(NSRect)rect -toData:(NSMutableData *)data - printInfo:(NSPrintInfo *)aPrintInfo; + toData:(NSMutableData *)data + printInfo:(NSPrintInfo *)aPrintInfo; + (NSPrintOperation *)EPSOperationWithView:(NSView *)aView insideRect:(NSRect)rect -toPath:(NSString *)path + toPath:(NSString *)path printInfo:(NSPrintInfo *)aPrintInfo; + (NSPrintOperation *)printOperationWithView:(NSView *)aView; + (NSPrintOperation *)printOperationWithView:(NSView *)aView printInfo:(NSPrintInfo *)aPrintInfo; - (id)initEPSOperationWithView:(NSView *)aView insideRect:(NSRect)rect -toData:(NSMutableData *)data + toData:(NSMutableData *)data printInfo:(NSPrintInfo *)aPrintInfo; - (id)initWithView:(NSView *)aView printInfo:(NSPrintInfo *)aPrintInfo; diff --git a/Headers/gnustep/gui/NSPrintPanel.h b/Headers/gnustep/gui/NSPrintPanel.h index 7f71bf287..696970ab4 100644 --- a/Headers/gnustep/gui/NSPrintPanel.h +++ b/Headers/gnustep/gui/NSPrintPanel.h @@ -29,12 +29,33 @@ #ifndef _GNUstep_H_NSPrintPanel #define _GNUstep_H_NSPrintPanel -#include #include -#include + +@class NSView; + +enum { + NSPPSaveButton, + NSPPPreviewButton, + NSFaxButton, + NSPPTitleField, + NSPPImageButton, + NSPPNameTitle, + NSPPNameField, + NSPPNoteTitle, + NSPPNoteField, + NSPPStatusTitle, + NSPPStatusField, + NSPPCopiesField, + NSPPPageChoiceMatrix, + NSPPPageRangeFrom, + NSPPPageRangeTo, + NSPPScaleField, + NSPPOptionsButton, + NSPPPaperFeedButton, + NSPPLayoutButton +}; @interface NSPrintPanel : NSPanel - { // Attributes } diff --git a/Headers/gnustep/gui/NSPrinter.h b/Headers/gnustep/gui/NSPrinter.h index 4c5e85ec1..e1d4a8852 100644 --- a/Headers/gnustep/gui/NSPrinter.h +++ b/Headers/gnustep/gui/NSPrinter.h @@ -29,11 +29,19 @@ #ifndef _GNUstep_H_NSPrinter #define _GNUstep_H_NSPrinter -#include #include -@interface NSPrinter : NSObject +@class NSString; +@class NSArray; +@class NSDictionary; +typedef enum _NSPrinterTableStatus { + NSPrinterTableOK, + NSPrinterTableNotFound, + NSPrinterTableError +} NSPrinterTableStatus; + +@interface NSPrinter : NSObject { // Attributes } diff --git a/Headers/gnustep/gui/NSResponder.h b/Headers/gnustep/gui/NSResponder.h index 4d53103b3..1ef8e5a11 100644 --- a/Headers/gnustep/gui/NSResponder.h +++ b/Headers/gnustep/gui/NSResponder.h @@ -29,15 +29,12 @@ #ifndef _GNUstep_H_NSResponder #define _GNUstep_H_NSResponder -#include -#include -#include -#include -#include #include -@interface NSResponder : NSObject +@class NSString; +@class NSEvent; +@interface NSResponder : NSObject { // Attributes id next_responder; diff --git a/Headers/gnustep/gui/NSSavePanel.h b/Headers/gnustep/gui/NSSavePanel.h index 142f808f4..932d78b50 100644 --- a/Headers/gnustep/gui/NSSavePanel.h +++ b/Headers/gnustep/gui/NSSavePanel.h @@ -29,16 +29,26 @@ #ifndef _GNUstep_H_NSSavePanel #define _GNUstep_H_NSSavePanel -#include -#include -#include #include +@class NSString; +@class NSView; + +enum { + NSFileHandlingPanelImageButton, + NSFileHandlingPanelTitleField, + NSFileHandlingPanelBrowser, + NSFileHandlingPanelCancelButton, + NSFileHandlingPanelOKButton, + NSFileHandlingPanelForm, + NSFileHandlingPanelHomeButton, + NSFileHandlingPanelDiskButton, + NSFileHandlingPanelDiskEjectButton +}; // Should be subclassed from NSPanel but // we are using the WIN32 common dialog @interface NSSavePanel : NSObject - { // Attributes NSView *accessory_view; @@ -113,12 +123,12 @@ // - (NSComparisonResult)panel:(id)sender compareFilename:(NSString *)filename1 -with:(NSString *)filename2 - caseSensitive:(BOOL)caseSensitive; + with:(NSString *)filename2 + caseSensitive:(BOOL)caseSensitive; - (BOOL)panel:(id)sender -shouldShowFilename:(NSString *)filename; + shouldShowFilename:(NSString *)filename; - (BOOL)panel:(id)sender -isValidFilename:(NSString*)filename; + isValidFilename:(NSString*)filename; // // NSCoding protocol diff --git a/Headers/gnustep/gui/NSScreen.h b/Headers/gnustep/gui/NSScreen.h index ac3082ced..5a15b28ac 100644 --- a/Headers/gnustep/gui/NSScreen.h +++ b/Headers/gnustep/gui/NSScreen.h @@ -29,12 +29,13 @@ #ifndef _GNUstep_H_NSScreen #define _GNUstep_H_NSScreen -#include -#include -#include +#include +#include + +@class NSDictionary; +@class NSMutableDictionary; @interface NSScreen : NSObject - { // Attributes NSMutableDictionary *device_desc; diff --git a/Headers/gnustep/gui/NSScrollView.h b/Headers/gnustep/gui/NSScrollView.h index cc3b593f1..c2f4cc8e4 100644 --- a/Headers/gnustep/gui/NSScrollView.h +++ b/Headers/gnustep/gui/NSScrollView.h @@ -29,13 +29,14 @@ #ifndef _GNUstep_H_NSScrollView #define _GNUstep_H_NSScrollView -#include #include -#include -#include + +@class NSScroller; +@class NSClipView; +@class NSColor; +@class NSCursor; @interface NSScrollView : NSView - { // Attributes } @@ -51,11 +52,11 @@ // + (NSSize)contentSizeForFrameSize:(NSSize)size hasHorizontalScroller:(BOOL)horizFlag -hasVerticalScroller:(BOOL)vertFlag - borderType:(NSBorderType)aType; + hasVerticalScroller:(BOOL)vertFlag + borderType:(NSBorderType)aType; + (NSSize)frameSizeForContentSize:(NSSize)size hasHorizontalScroller:(BOOL)horizFlag -hasVerticalScroller:(BOOL)vertFlag + hasVerticalScroller:(BOOL)vertFlag borderType:(NSBorderType)aType; - (void)setHasHorizontalScroller:(BOOL)flag; - (BOOL)hasHorizontalScroller; diff --git a/Headers/gnustep/gui/NSScroller.h b/Headers/gnustep/gui/NSScroller.h index 6ebcf4f53..ff830b131 100644 --- a/Headers/gnustep/gui/NSScroller.h +++ b/Headers/gnustep/gui/NSScroller.h @@ -29,12 +29,40 @@ #ifndef _GNUstep_H_NSScroller #define _GNUstep_H_NSScroller -#include #include -#include + +@class NSEvent; + +typedef enum _NSScrollArrowPosition { + NSScrollerArrowsMaxEnd, + NSScrollerArrowsMinEnd, + NSScrollerArrowsNone +} NSScrollArrowPosition; + +typedef enum _NSScrollerPart { + NSScrollerNoPart, + NSScrollerDecrementPage, + NSScrollerKnob, + NSScrollerIncrementPage, + NSScrollerDecrementLine, + NSScrollerIncrementLine, + NSScrollerKnobSlot +} NSScrollerPart; + +typedef enum _NSScrollerUsablePart { + NSNoScrollerParts, + NSOnlyScrollerArrows, + NSAllScrollerParts +} NSUsableScrollerParts; + +typedef enum _NSScrollerArrow { + NSScrollerIncrementArrow, + NSScrollerDecrementArrow +} NSScrollerArrow; + +extern const float NSScrollerWidth; @interface NSScroller : NSControl - { // Attributes BOOL is_horizontal; diff --git a/Headers/gnustep/gui/NSSelection.h b/Headers/gnustep/gui/NSSelection.h index ab6fb5274..e839b7e36 100644 --- a/Headers/gnustep/gui/NSSelection.h +++ b/Headers/gnustep/gui/NSSelection.h @@ -29,12 +29,12 @@ #ifndef _GNUstep_H_NSSelection #define _GNUstep_H_NSSelection -#include -#include #include -@interface NSSelection : NSObject +@class NSData; +@class NSPasteboard; +@interface NSSelection : NSObject { // Attributes } diff --git a/Headers/gnustep/gui/NSSlider.h b/Headers/gnustep/gui/NSSlider.h index 6ee17275c..2a9d641ad 100644 --- a/Headers/gnustep/gui/NSSlider.h +++ b/Headers/gnustep/gui/NSSlider.h @@ -29,12 +29,16 @@ #ifndef _GNUstep_H_NSSlider #define _GNUstep_H_NSSlider -#include #include -#include + +@class NSString; +@class NSImage; +@class NSCell; +@class NSFont; +@class NSColor; +@class NSEvent; @interface NSSlider : NSControl - { // Attributes } diff --git a/Headers/gnustep/gui/NSSliderCell.h b/Headers/gnustep/gui/NSSliderCell.h index bf9202439..94a3cc4ef 100644 --- a/Headers/gnustep/gui/NSSliderCell.h +++ b/Headers/gnustep/gui/NSSliderCell.h @@ -29,12 +29,13 @@ #ifndef _GNUstep_H_NSSliderCell #define _GNUstep_H_NSSliderCell -#include #include -#include + +@class NSString; +@class NSColor; +@class NSFont; @interface NSSliderCell : NSActionCell - { // Attributes double max_value; diff --git a/Headers/gnustep/gui/NSSpellChecker.h b/Headers/gnustep/gui/NSSpellChecker.h index 45777a680..e339400a3 100644 --- a/Headers/gnustep/gui/NSSpellChecker.h +++ b/Headers/gnustep/gui/NSSpellChecker.h @@ -29,13 +29,15 @@ #ifndef _GNUstep_H_NSSpellChecker #define _GNUstep_H_NSSpellChecker -#include -#include -#include +#include #include -@interface NSSpellChecker : NSObject +@class NSString; +@class NSArray; +@class NSView; +@class NSPanel; +@interface NSSpellChecker : NSObject { // Attributes } @@ -62,10 +64,10 @@ startingAt:(int)startingOffset; - (NSRange)checkSpellingOfString:(NSString *)stringToCheck startingAt:(int)startingOffset -language:(NSString *)language - wrap:(BOOL)wrapFlag -inSpellDocumentWithTag:(int)tag - wordCount:(int *)wordCount; + language:(NSString *)language + wrap:(BOOL)wrapFlag + inSpellDocumentWithTag:(int)tag + wordCount:(int *)wordCount; // // Setting the Language @@ -79,10 +81,10 @@ inSpellDocumentWithTag:(int)tag + (int)uniqueSpellDocumentTag; - (void)closeSpellDocumentWithTag:(int)tag; - (void)ignoreWord:(NSString *)wordToIgnore -inSpellDocumentWithTag:(int)tag; + inSpellDocumentWithTag:(int)tag; - (NSArray *)ignoredWordsInSpellDocumentWithTag:(int)tag; - (void)setIgnoredWords:(NSArray *)someWords - inSpellDocumentWithTag:(int)tag; + inSpellDocumentWithTag:(int)tag; - (void)setWordFieldStringValue:(NSString *)aString; - (void)updateSpellingPanelWithMisspelledWord:(NSString *)word; diff --git a/Headers/gnustep/gui/NSSpellServer.h b/Headers/gnustep/gui/NSSpellServer.h index 4b99298eb..6b0c6e397 100644 --- a/Headers/gnustep/gui/NSSpellServer.h +++ b/Headers/gnustep/gui/NSSpellServer.h @@ -29,8 +29,7 @@ #ifndef _GNUstep_H_NSSpellServer #define _GNUstep_H_NSSpellServer -#include -#include +#include @interface NSSpellServer : NSObject diff --git a/Headers/gnustep/gui/NSSplitView.h b/Headers/gnustep/gui/NSSplitView.h index 84cee2949..f63abd777 100644 --- a/Headers/gnustep/gui/NSSplitView.h +++ b/Headers/gnustep/gui/NSSplitView.h @@ -29,13 +29,12 @@ #ifndef _GNUstep_H_NSSplitView #define _GNUstep_H_NSSplitView -#include #include -#include -#include + +@class NSString; +@class NSNotification; @interface NSSplitView : NSView - { // Attributes } @@ -57,11 +56,11 @@ // Implemented by the Delegate // - (void)splitView:(NSSplitView *)splitView -constrainMinCoordinate:(float *)min - maxCoordinate:(float *)max - ofSubviewAt:(int)offset; + constrainMinCoordinate:(float *)min + maxCoordinate:(float *)max + ofSubviewAt:(int)offset; - (void)splitView:(NSSplitView *)sender -resizeSubviewsWithOldSize:(NSSize)oldSize; + resizeSubviewsWithOldSize:(NSSize)oldSize; - (void)splitViewDidResizeSubviews:(NSNotification *)notification; - (void)splitViewWillResizeSubviews:(NSNotification *)notification; @@ -73,4 +72,7 @@ resizeSubviewsWithOldSize:(NSSize)oldSize; @end +extern NSString *NSSplitViewDidResizeSubviewsNotification; +extern NSString *NSSplitViewWillResizeSubviewsNotification; + #endif // _GNUstep_H_NSSplitView diff --git a/Headers/gnustep/gui/NSText.h b/Headers/gnustep/gui/NSText.h index 7f61f7491..2e4613ec4 100644 --- a/Headers/gnustep/gui/NSText.h +++ b/Headers/gnustep/gui/NSText.h @@ -29,15 +29,35 @@ #ifndef _GNUstep_H_NSText #define _GNUstep_H_NSText -#include #include -#include #include -#include -#include + +@class NSString; +@class NSData; +@class NSNotification; +@class NSColor; +@class NSFont; + +typedef enum _NSTextAlignment { + NSLeftTextAlignment, + NSRightTextAlignment, + NSCenterTextAlignment, + NSJustifiedTextAlignment, + NSNaturalTextAlignment +} NSTextAlignment; + +enum { + NSIllegalTextMovement = 0, + NSReturnTextMovement = 0x10, + NSTabTextMovement = 0x11, + NSBacktabTextMovement = 0x12, + NSLeftTextMovement = 0x13, + NSRightTextMovement = 0x14, + NSUpTextMovement = 0x15, + NSDownTextMovement = 0x16 +}; @interface NSText : NSView - { // Attributes id delegate; @@ -209,4 +229,9 @@ @end +/* Notifications */ +extern NSString *NSTextDidBeginEditingNotification; +extern NSString *NSTextDidEndEditingNotification; +extern NSString *NSTextDidChangeNotification; + #endif // _GNUstep_H_NSText diff --git a/Headers/gnustep/gui/NSTextField.h b/Headers/gnustep/gui/NSTextField.h index dc3b705c1..10af97efc 100644 --- a/Headers/gnustep/gui/NSTextField.h +++ b/Headers/gnustep/gui/NSTextField.h @@ -29,22 +29,19 @@ #ifndef _GNUstep_H_NSTextField #define _GNUstep_H_NSTextField -#include #include -#include -#include -#include -#include + +@class NSNotification; +@class NSColor; +@class NSText; @interface NSTextField : NSControl - { // Attributes id next_text; id previous_text; id text_delegate; SEL error_action; - NSCursor *text_cursor; } // diff --git a/Headers/gnustep/gui/NSTextFieldCell.h b/Headers/gnustep/gui/NSTextFieldCell.h index b81e05777..877e15709 100644 --- a/Headers/gnustep/gui/NSTextFieldCell.h +++ b/Headers/gnustep/gui/NSTextFieldCell.h @@ -29,14 +29,11 @@ #ifndef _GNUstep_H_NSTextFieldCell #define _GNUstep_H_NSTextFieldCell -#include #include -#include -#include -#include + +@class NSColor; @interface NSTextFieldCell : NSActionCell - { // Attributes NSColor *background_color; diff --git a/Headers/gnustep/gui/NSView.h b/Headers/gnustep/gui/NSView.h index 939c0016b..7b8abd460 100644 --- a/Headers/gnustep/gui/NSView.h +++ b/Headers/gnustep/gui/NSView.h @@ -29,19 +29,41 @@ #ifndef _GNUstep_H_NSView #define _GNUstep_H_NSView -#include +#include #include -#include -#include -#include -#include -#include + +@class NSString; +@class NSArray; +@class NSMutableArray; +@class NSData; @class NSWindow; +@class NSPasteboard; +@class NSView; @class NSClipView; +@class NSImage; +@class NSCursor; + +typedef int NSTrackingRectTag; + +typedef enum _NSBorderType { + NSNoBorder, + NSLineBorder, + NSBezelBorder, + NSGrooveBorder +} NSBorderType; + +enum { + NSViewNotSizable, + NSViewMinXMargin, + NSViewWidthSizable, + NSViewMaxXMargin, + NSViewMinYMargin, + NSViewHeightSizable, + NSViewMaxYMargin +}; @interface NSView : NSResponder - { // Attributes NSRect frame; @@ -52,7 +74,6 @@ NSMutableArray *sub_views; id window; NSMutableArray *tracking_rects; - NSMutableArray *cursor_rects; BOOL is_flipped; BOOL is_rotated_from_base; @@ -208,7 +229,6 @@ - (void)removeCursorRect:(NSRect)aRect cursor:(NSCursor *)anObject; - (void)resetCursorRects; -- (NSArray *)cursorRectangles; // // Assigning a Tag @@ -229,7 +249,7 @@ - (NSTrackingRectTag)addTrackingRect:(NSRect)aRect owner:(id)anObject userData:(void *)data - assumeInside:(BOOL)flag; + assumeInside:(BOOL)flag; - (NSArray *)trackingRectangles; // @@ -312,4 +332,8 @@ @end +/* Notifications */ +extern NSString *NSViewFrameChangedNotification; +extern NSString *NSViewFocusChangedNotification; + #endif // _GNUstep_H_NSView diff --git a/Headers/gnustep/gui/NSWindow.h b/Headers/gnustep/gui/NSWindow.h index f129754f6..b3beedb11 100644 --- a/Headers/gnustep/gui/NSWindow.h +++ b/Headers/gnustep/gui/NSWindow.h @@ -29,21 +29,47 @@ #ifndef _GNUstep_H_NSWindow #define _GNUstep_H_NSWindow -#include +#include +#include #include -#include #include -#include -#include -#include -#include -#include -#include -#include -#include +#include + +@class NSString; +@class NSArray; +@class NSData; +@class NSDictionary; +@class NSNotification; +@class NSDate; + +@class NSColor; +@class NSImage; +@class NSScreen; +@class NSEvent; +@class NSPasteboard; +@class NSView; +@class NSText; + +enum { + NSNormalWindowLevel = 0, + NSFloatingWindowLevel = 3, + NSDockWindowLevel = 5, + NSSubmenuWindowLevel = 10, + NSMainMenuWindowLevel = 20 +}; + +enum { + NSBorderlessWindowMask = 1, + NSTitledWindowMask = 2, + NSClosableWindowMask = 4, + NSMiniaturizableWindowMask = 8, + NSResizableWindowMask = 16 +}; + +extern NSSize NSIconSize; +extern NSSize NSTokenSize; @interface NSWindow : NSResponder - { // Attributes NSRect frame; @@ -73,7 +99,6 @@ BOOL dynamic_depth_limit; BOOL cursor_rects_enabled; - BOOL cursor_rects_valid; BOOL visible; BOOL is_key; @@ -389,4 +414,20 @@ @end +/* Notifications */ +extern NSString *NSWindowDidBecomeKeyNotification; +extern NSString *NSWindowDidBecomeMainNotification; +extern NSString *NSWindowDidChangeScreenNotification; +extern NSString *NSWindowDidDeminiaturizeNotification; +extern NSString *NSWindowDidExposeNotification; +extern NSString *NSWindowDidMiniaturizeNotification; +extern NSString *NSWindowDidMoveNotification; +extern NSString *NSWindowDidResignKeyNotification; +extern NSString *NSWindowDidResignMainNotification; +extern NSString *NSWindowDidResizeNotification; +extern NSString *NSWindowDidUpdateNotification; +extern NSString *NSWindowWillCloseNotification; +extern NSString *NSWindowWillMiniaturizeNotification; +extern NSString *NSWindowWillMoveNotification; + #endif // _GNUstep_H_NSWindow diff --git a/Headers/gnustep/gui/NSWorkspace.h b/Headers/gnustep/gui/NSWorkspace.h index 150bbbf6d..0daa4e5e3 100644 --- a/Headers/gnustep/gui/NSWorkspace.h +++ b/Headers/gnustep/gui/NSWorkspace.h @@ -29,13 +29,16 @@ #ifndef _GNUstep_H_NSWorkspace #define _GNUstep_H_NSWorkspace -#include -#include -#include -#include +#include +#include + +@class NSString; +@class NSArray; +@class NSNotificationCenter; +@class NSImage; +@class NSView; @interface NSWorkspace : NSObject - { // Attributes } @@ -51,13 +54,13 @@ - (BOOL)openFile:(NSString *)fullPath; - (BOOL)openFile:(NSString *)fullPath fromImage:(NSImage *)anImage -at:(NSPoint)point - inView:(NSView *)aView; + at:(NSPoint)point + inView:(NSView *)aView; - (BOOL)openFile:(NSString *)fullPath - withApplication:(NSString *)appName; + withApplication:(NSString *)appName; - (BOOL)openFile:(NSString *)fullPath - withApplication:(NSString *)appName -andDeactivate:(BOOL)flag; + withApplication:(NSString *)appName + andDeactivate:(BOOL)flag; - (BOOL)openTempFile:(NSString *)fullPath; // @@ -65,11 +68,11 @@ andDeactivate:(BOOL)flag; // - (BOOL)performFileOperation:(NSString *)operation source:(NSString *)source -destination:(NSString *)destination - files:(NSArray *)files -tag:(int *)tag; + destination:(NSString *)destination + files:(NSArray *)files + tag:(int *)tag; - (BOOL)selectFile:(NSString *)fullPath -inFileViewerRootedAtPath:(NSString *)rootFullpath; + inFileViewerRootedAtPath:(NSString *)rootFullpath; // // Requesting Information about Files @@ -77,13 +80,13 @@ inFileViewerRootedAtPath:(NSString *)rootFullpath; - (NSString *)fullPathForApplication:(NSString *)appName; - (BOOL)getFileSystemInfoForPath:(NSString *)fullPath isRemovable:(BOOL *)removableFlag -isWritable:(BOOL *)writableFlag - isUnmountable:(BOOL *)unmountableFlag -description:(NSString **)description - type:(NSString **)fileSystemType; + isWritable:(BOOL *)writableFlag + isUnmountable:(BOOL *)unmountableFlag + description:(NSString **)description + type:(NSString **)fileSystemType; - (BOOL)getInfoForFile:(NSString *)fullPath application:(NSString **)appName -type:(NSString **)type; + type:(NSString **)type; - (NSImage *)iconForFile:(NSString *)fullPath; - (NSImage *)iconForFiles:(NSArray *)pathArray; - (NSImage *)iconForFileType:(NSString *)fileType; @@ -106,7 +109,7 @@ type:(NSString **)type; - (BOOL)launchApplication:(NSString *)appName; - (BOOL)launchApplication:(NSString *)appName showIcon:(BOOL)showIcon -autolaunch:(BOOL)autolaunch; + autolaunch:(BOOL)autolaunch; // // Unmounting a Device @@ -136,7 +139,7 @@ autolaunch:(BOOL)autolaunch; // - (void)slideImage:(NSImage *)image from:(NSPoint)fromPoint -to:(NSPoint)toPoint; + to:(NSPoint)toPoint; // // Requesting Additional Time before Power Off or Logout @@ -145,4 +148,38 @@ to:(NSPoint)toPoint; @end + +/* Notifications */ +extern NSString *NSWorkspaceDidLaunchApplicationNotification; +extern NSString *NSWorkspaceDidMountNotification; +extern NSString *NSWorkspaceDidPerformFileOperationNotification; +extern NSString *NSWorkspaceDidTerminateApplicationNotification; +extern NSString *NSWorkspaceDidUnmountNotification; +extern NSString *NSWorkspaceWillLaunchApplicationNotification; +extern NSString *NSWorkspaceWillPowerOffNotification; +extern NSString *NSWorkspaceWillUnmountNotification; + +// +// Workspace File Type Globals +// +extern NSString *NSPlainFileType; +extern NSString *NSDirectoryFileType; +extern NSString *NSApplicationFileType; +extern NSString *NSFilesystemFileType; +extern NSString *NSShellCommandFileType; + +// +// Workspace File Operation Globals +// +extern NSString *NSWorkspaceCompressOperation; +extern NSString *NSWorkspaceCopyOperation; +extern NSString *NSWorkspaceDecompressOperation; +extern NSString *NSWorkspaceDecryptOperation; +extern NSString *NSWorkspaceDestroyOperation; +extern NSString *NSWorkspaceDuplicateOperation; +extern NSString *NSWorkspaceEncryptOperation; +extern NSString *NSWorkspaceLinkOperation; +extern NSString *NSWorkspaceMoveOperation; +extern NSString *NSWorkspaceRecycleOperation; + #endif // _GNUstep_H_NSWorkspace diff --git a/Headers/gnustep/gui/TrackingRectangle.h b/Headers/gnustep/gui/TrackingRectangle.h index be61baa6b..f4899bf7d 100644 --- a/Headers/gnustep/gui/TrackingRectangle.h +++ b/Headers/gnustep/gui/TrackingRectangle.h @@ -29,11 +29,9 @@ #ifndef _GNUstep_H_TrackingRectangle #define _GNUstep_H_TrackingRectangle -#include -#include +#include @interface TrackingRectangle : NSObject - { // Attributes NSRect rectangle; @@ -45,10 +43,10 @@ // Instance methods - initWithRect:(NSRect)aRect - tag:(NSTrackingRectTag)aTag - owner:anObject - userData:(void *)theData - inside:(BOOL)flag; + tag:(NSTrackingRectTag)aTag + owner:anObject + userData:(void *)theData + inside:(BOOL)flag; - (NSRect)rectangle; - (NSTrackingRectTag)tag; diff --git a/Headers/gnustep/gui/TypesandConstants.h b/Headers/gnustep/gui/TypesandConstants.h deleted file mode 100644 index e3977c531..000000000 --- a/Headers/gnustep/gui/TypesandConstants.h +++ /dev/null @@ -1,1130 +0,0 @@ -/* TypesandConstants.h - - Type and Constant definitions for the GNUstep GUI Library - - Copyright (C) 1996 Free Software Foundation, Inc. - - Author: Scott Christley - Date: 1996 - - This file is part of the GNUstep GUI Library. - - This library is free software; you can redistribute it and/or - modify it under the terms of the GNU Library General Public - License as published by the Free Software Foundation; either - version 2 of the License, or (at your option) any later version. - - This library is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - Library General Public License for more details. - - You should have received a copy of the GNU Library General Public - License along with this library; see the file COPYING.LIB. - If not, write to the Free Software Foundation, - 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. -*/ - -#ifndef _GNUstep_H_GUITypes -#define _GNUstep_H_GUITypes - -#include - -// -// Application -// -extern id NSApp; -typedef struct _NSModalSession *NSModalSession; - -enum { - NSRunStoppedResponse, - NSRunAbortedResponse, - NSRunContinuesResponse -}; - -extern NSString *NSModalPanelRunLoopMode; -extern NSString *NSEventTrackingRunLoopMode; - -// -// Box -// -typedef enum _NSTitlePosition { - NSNoTitle, - NSAboveTop, - NSAtTop, - NSBelowTop, - NSAboveBottom, - NSAtBottom, - NSBelowBottom -} NSTitlePosition; - -// -// Buttons -// -typedef enum _NSButtonType { - NSMomentaryPushButton, - NSPushOnPushOffButton, - NSToggleButton, - NSSwitchButton, - NSRadioButton, - NSMomentaryChangeButton, - NSOnOffButton -} NSButtonType; - -// -// Cells and Button Cells -// -typedef enum _NSCellType { - NSNullCellType, - NSTextCellType, - NSImageCellType -} NSCellType; - -typedef enum _NSCellImagePosition { - NSNoImage, - 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 -} NSCellAttribute; - -enum { - NSAnyType, - NSIntType, - NSPositiveIntType, - NSFloatType, - NSPositiveFloatType, - NSDateType, - NSDoubleType, - NSPositiveDoubleType -}; - -enum { - NSNoCellMask, - NSContentsCellMask, - NSPushInCellMask, - NSChangeGrayCellMask, - NSChangeBackgroundCellMask -}; - -// -// Color -// -enum { - NSGrayModeColorPanel, - NSRGBModeColorPanel, - NSCMYKModeColorPanel, - NSHSBModeColorPanel, - NSCustomPaletteModeColorPanel, - NSColorListModeColorPanel, - NSWheelModeColorPanel -}; - -enum { - NSColorPanelGrayModeMask, - NSColorPanelRGBModeMask, - NSColorPanelCMYKModeMask, - NSColorPanelHSBModeMask, - NSColorPanelCustomPaletteModeMask, - NSColorPanelColorListModeMask, - NSColorPanelWheelModeMask, - NSColorPanelAllModesMask -}; - -// -// Data Link -// -typedef int NSDataLinkNumber; -extern NSString *NSDataLinkFileNameExtension; -typedef enum _NSDataLinkDisposition { - NSLinkInDestination, - NSLinkInSource, - NSLinkBroken -} NSDataLinkDisposition; - -typedef enum _NSDataLinkUpdateMode { - NSUpdateContinuously, - NSUpdateWhenSourceSaved, - NSUpdateManually, - NSUpdateNever -} NSDataLinkUpdateMode; - -// -// Drag Operation -// -typedef enum _NSDragOperation { - NSDragOperationNone, - NSDragOperationCopy, - NSDragOperationLink, - NSDragOperationGeneric, - NSDragOperationPrivate, - NSDragOperationAll -} NSDragOperation; - -// -// Event Handling -// -typedef enum _NSEventType { - NSLeftMouseDown, - NSLeftMouseUp, - NSRightMouseDown, - NSRightMouseUp, - NSMouseMoved, - NSLeftMouseDragged, - NSRightMouseDragged, - NSMouseEntered, - NSMouseExited, - NSKeyDown, - NSKeyUp, - NSFlagsChanged, - NSPeriodic, - NSCursorUpdate -} NSEventType; - -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 -}; - -enum { - NSAlphaShiftKeyMask = 1, - NSShiftKeyMask = 2, - NSControlKeyMask = 4, - NSAlternateKeyMask = 8, - NSCommandKeyMask = 16, - NSNumericPadKeyMask = 32, - NSHelpKeyMask = 64, - NSFunctionKeyMask = 128 -}; - -enum { - NSLeftMouseDownMask = 1, - NSLeftMouseUpMask = 2, - NSRightMouseDownMask = 4, - NSRightMouseUpMask = 8, - NSMouseMovedMask = 16, - NSLeftMouseDraggedMask = 32, - NSRightMouseDraggedMask = 64, - NSMouseEnteredMask = 128, - NSMouseExitedMask = 256, - NSKeyDownMask = 512, - NSKeyUpMask = 1024, - NSFlagsChangedMask = 2048, - NSPeriodicMask = 4096, - NSCursorUpdateMask = 8192, -// Note that NSAnyEventMask is an OR-combination of all other event masks - NSAnyEventMask = 16383 -}; - -// -// Exceptions -// - -// -// Global Exception Strings -// -extern NSString *NSAbortModalException; -extern NSString *NSAbortPrintingException; -extern NSString *NSAppKitIgnoredException; -extern NSString *NSAppKitVirtualMemoryException; -extern NSString *NSBadBitmapParametersException; -extern NSString *NSBadComparisonException; -extern NSString *NSBadRTFColorTableException; -extern NSString *NSBadRTFDirectiveException; -extern NSString *NSBadRTFFontTableException; -extern NSString *NSBadRTFStyleSheetException; -extern NSString *NSBrowserIllegalDelegateException; -extern NSString *NSColorListIOException; -extern NSString *NSColorListNotEditableException; -extern NSString *NSDraggingException; -extern NSString *NSFontUnavailableException; -extern NSString *NSIllegalSelectorException; -extern NSString *NSImageCacheException; -extern NSString *NSNibLoadingException; -extern NSString *NSPPDIncludeNotFoundException; -extern NSString *NSPPDIncludeStackOverflowException; -extern NSString *NSPPDIncludeStackUnderflowException; -extern NSString *NSPPDParseException; -extern NSString *NSPasteboardCommunicationException; -extern NSString *NSPrintOperationExistsException; -extern NSString *NSPrintPackageException; -extern NSString *NSPrintingCommunicationException; -extern NSString *NSRTFPropertyStackOverflowException; -extern NSString *NSTIFFException; -extern NSString *NSTextLineTooLongException; -extern NSString *NSTextNoSelectionException; -extern NSString *NSTextReadException; -extern NSString *NSTextWriteException; -extern NSString *NSTypedStreamVersionException; -extern NSString *NSWindowServerCommunicationException; -extern NSString *NSWordTablesReadException; -extern NSString *NSWordTablesWriteException; - -// -// Fonts -// -typedef unsigned int NSFontTraitMask; - -enum { - NSItalicFontMask = 1, - NSBoldFontMask = 2, - NSUnboldFontMask = 4, - NSNonStandardCharacterSetFontMask = 8, - NSNarrowFontMask = 16, - NSExpandedFontMask = 32, - NSCondensedFontMask = 64, - NSSmallCapsFontMask = 128, - NSPosterFontMask = 256, - NSCompressedFontMask = 512, - NSUnitalicFontMask = 1024 -}; - -typedef unsigned int NSGlyph; - -enum { - NSFPPreviewButton , - NSFPRevertButton, - NSFPSetButton, - NSFPPreviewField, - NSFPSizeField, - NSFPSizeTitle, - NSFPCurrentField -}; - -const float *NSFontIdentityMatrix; - -extern NSString *NSAFMAscender; -extern NSString *NSAFMCapHeight; -extern NSString *NSAFMCharacterSet; -extern NSString *NSAFMDescender; -extern NSString *NSAFMEncodingScheme; -extern NSString *NSAFMFamilyName; -extern NSString *NSAFMFontName; -extern NSString *NSAFMFormatVersion; -extern NSString *NSAFMFullName; -extern NSString *NSAFMItalicAngle; -extern NSString *NSAFMMappingScheme; -extern NSString *NSAFMNotice; -extern NSString *NSAFMUnderlinePosition; -extern NSString *NSAFMUnderlineThickness; -extern NSString *NSAFMVersion; -extern NSString *NSAFMWeight; -extern NSString *NSAFMXHeight; - -// -// Graphics -// -typedef int NSWindowDepth; - -typedef enum _NSTIFFCompression { - NSTIFFCompressionNone = 1, - NSTIFFCompressionCCITTFAX3 = 3, - NSTIFFCompressionCCITTFAX4 = 4, - NSTIFFCompressionLZW = 5, - NSTIFFCompressionJPEG = 6, - NSTIFFCompressionNEXT = 32766, - NSTIFFCompressionPackBits = 32773, - NSTIFFCompressionOldJPEG = 32865 -} NSTIFFCompression; - -enum { - NSImageRepMatchesDevice -}; - -// -// Colorspace Names -// -extern NSString *NSCalibratedWhiteColorSpace; -extern NSString *NSCalibratedBlackColorSpace; -extern NSString *NSCalibratedRGBColorSpace; -extern NSString *NSDeviceWhiteColorSpace; -extern NSString *NSDeviceBlackColorSpace; -extern NSString *NSDeviceRGBColorSpace; -extern NSString *NSDeviceCMYKColorSpace; -extern NSString *NSNamedColorSpace; -extern NSString *NSCustomColorSpace; - -// -// Gray Values -// -extern const float NSBlack; -extern const float NSDarkGray; -extern const float NSWhite; -extern const float NSLightGray; - -// -// Device Dictionary Keys -// -extern NSString *NSDeviceResolution; -extern NSString *NSDeviceColorSpaceName; -extern NSString *NSDeviceBitsPerSample; -extern NSString *NSDeviceIsScreen; -extern NSString *NSDeviceIsPrinter; -extern NSString *NSDeviceSize; - -// -// Matrix -// -typedef enum _NSMatrixMode { - NSRadioModeMatrix, - NSHighlightModeMatrix, - NSListModeMatrix, - NSTrackModeMatrix -} NSMatrixMode; - -// -// Notifications -// -// NSApplication -extern NSString *NSApplicationDidBecomeActiveNotification; -extern NSString *NSApplicationDidFinishLaunchingNotification; -extern NSString *NSApplicationDidHideNotification; -extern NSString *NSApplicationDidResignActiveNotification; -extern NSString *NSApplicationDidUnhideNotification; -extern NSString *NSApplicationDidUpdateNotification; -extern NSString *NSApplicationWillBecomeActiveNotification; -extern NSString *NSApplicationWillFinishLaunchingNotification; -extern NSString *NSApplicationWillHideNotification; -extern NSString *NSApplicationWillResignActiveNotification; -extern NSString *NSApplicationWillUnhideNotification; -extern NSString *NSApplicationWillUpdateNotification; - -// NSColorList -extern NSString *NSColorListChangedNotification; -// NSColorPanel -extern NSString *NSColorPanelColorChangedNotification; - -// NSControl -extern NSString *NSControlTextDidBeginEditingNotification; -extern NSString *NSControlTextDidEndEditingNotification; -extern NSString *NSControlTextDidChangeNotification; - -// NSImageRep -extern NSString *NSImageRepRegistryChangedNotification; - -// NSSplitView -extern NSString *NSSplitViewDidResizeSubviewsNotification; -extern NSString *NSSplitViewWillResizeSubviewsNotification; - -// NSText -extern NSString *NSTextDidBeginEditingNotification; -extern NSString *NSTextDidEndEditingNotification; -extern NSString *NSTextDidChangeNotification; - -// NSView -extern NSString *NSViewFrameChangedNotification; -extern NSString *NSViewFocusChangedNotification; - -// NSWindow -extern NSString *NSWindowDidBecomeKeyNotification; -extern NSString *NSWindowDidBecomeMainNotification; -extern NSString *NSWindowDidChangeScreenNotification; -extern NSString *NSWindowDidDeminiaturizeNotification; -extern NSString *NSWindowDidExposeNotification; -extern NSString *NSWindowDidMiniaturizeNotification; -extern NSString *NSWindowDidMoveNotification; -extern NSString *NSWindowDidResignKeyNotification; -extern NSString *NSWindowDidResignMainNotification; -extern NSString *NSWindowDidResizeNotification; -extern NSString *NSWindowDidUpdateNotification; -extern NSString *NSWindowWillCloseNotification; -extern NSString *NSWindowWillMiniaturizeNotification; -extern NSString *NSWindowWillMoveNotification; - -// NSWorkspace -extern NSString *NSWorkspaceDidLaunchApplicationNotification; -extern NSString *NSWorkspaceDidMountNotification; -extern NSString *NSWorkspaceDidPerformFileOperationNotification; -extern NSString *NSWorkspaceDidTerminateApplicationNotification; -extern NSString *NSWorkspaceDidUnmountNotification; -extern NSString *NSWorkspaceWillLaunchApplicationNotification; -extern NSString *NSWorkspaceWillPowerOffNotification; -extern NSString *NSWorkspaceWillUnmountNotification; - -// -// Panel -// -enum { - NSOKButton = 1, - NSCancelButton = 0 -}; - -enum { - NSAlertDefaultReturn = 1, - NSAlertAlternateReturn = 0, - NSAlertOtherReturn = -1, - NSAlertErrorReturn = -2 -}; - -// -// Page Layout -// -enum { - NSPLImageButton, - NSPLTitleField, - NSPLPaperNameButton, - NSPLUnitsButton, - NSPLWidthForm, - NSPLHeightForm, - NSPLOrientationMatrix, - NSPLCancelButton, - NSPLOKButton -}; - -// -// Pasteboard -// - -// -// Pasteboard Type Globals -// -extern NSString *NSStringPboardType; -extern NSString *NSColorPboardType; -extern NSString *NSFileContentsPboardType; -extern NSString *NSFilenamesPboardType; -extern NSString *NSFontPboardType; -extern NSString *NSRulerPboardType; -extern NSString *NSPostScriptPboardType; -extern NSString *NSTabularTextPboardType; -extern NSString *NSRTFPboardType; -extern NSString *NSTIFFPboardType; -extern NSString *NSDataLinkPboardType; -extern NSString *NSGeneralPboardType; - -// -// Pasteboard Name Globals -// -extern NSString *NSDragPboard; -extern NSString *NSFindPboard; -extern NSString *NSFontPboard; -extern NSString *NSGeneralPboard; -extern NSString *NSRulerPboard; - -// -// Printing -// -typedef enum _NSPrinterTableStatus { - NSPrinterTableOK, - NSPrinterTableNotFound, - NSPrinterTableError -} NSPrinterTableStatus; - -typedef enum _NSPrintingOrientation { - NSPortraitOrientation, - NSLandscapeOrientation -} NSPrintingOrientation; - -typedef enum _NSPrintingPageOrder { - NSDescendingPageOrder, - NSSpecialPageOrder, - NSAscendingPageOrder, - NSUnknownPageOrder -} NSPrintingPageOrder; - -typedef enum _NSPrintingPaginationMode { - NSAutoPagination, - NSFitPagination, - NSClipPagination -} NSPrintingPaginationMode; - -enum { - NSPPSaveButton, - NSPPPreviewButton, - NSFaxButton, - NSPPTitleField, - NSPPImageButton, - NSPPNameTitle, - NSPPNameField, - NSPPNoteTitle, - NSPPNoteField, - NSPPStatusTitle, - NSPPStatusField, - NSPPCopiesField, - NSPPPageChoiceMatrix, - NSPPPageRangeFrom, - NSPPPageRangeTo, - NSPPScaleField, - NSPPOptionsButton, - NSPPPaperFeedButton, - NSPPLayoutButton -}; - -// -// Printing Information Dictionary Keys -// -extern NSString *NSPrintAllPages; -extern NSString *NSPrintBottomMargin; -extern NSString *NSPrintCopies; -extern NSString *NSPrintFaxCoverSheetName; -extern NSString *NSPrintFaxHighResolution; -extern NSString *NSPrintFaxModem; -extern NSString *NSPrintFaxReceiverNames; -extern NSString *NSPrintFaxReceiverNumbers; -extern NSString *NSPrintFaxReturnReceipt; -extern NSString *NSPrintFaxSendTime; -extern NSString *NSPrintFaxTrimPageEnds; -extern NSString *NSPrintFaxUseCoverSheet; -extern NSString *NSPrintFirstPage; -extern NSString *NSPrintHorizonalPagination; -extern NSString *NSPrintHorizontallyCentered; -extern NSString *NSPrintJobDisposition; -extern NSString *NSPrintJobFeatures; -extern NSString *NSPrintLastPage; -extern NSString *NSPrintLeftMargin; -extern NSString *NSPrintManualFeed; -extern NSString *NSPrintOrientation; -extern NSString *NSPrintPackageException; -extern NSString *NSPrintPagesPerSheet; -extern NSString *NSPrintPaperFeed; -extern NSString *NSPrintPaperName; -extern NSString *NSPrintPaperSize; -extern NSString *NSPrintPrinter; -extern NSString *NSPrintReversePageOrder; -extern NSString *NSPrintRightMargin; -extern NSString *NSPrintSavePath; -extern NSString *NSPrintScalingFactor; -extern NSString *NSPrintTopMargin; -extern NSString *NSPrintVerticalPagination; -extern NSString *NSPrintVerticallyCentered; - -// -// Print Job Disposition Values -// -extern NSString *NSPrintCancelJob; -extern NSString *NSPrintFaxJob; -extern NSString *NSPrintPreviewJob; -extern NSString *NSPrintSaveJob; -extern NSString *NSPrintSpoolJob; - -// -// Save Panel -// -enum { - NSFileHandlingPanelImageButton, - NSFileHandlingPanelTitleField, - NSFileHandlingPanelBrowser, - NSFileHandlingPanelCancelButton, - NSFileHandlingPanelOKButton, - NSFileHandlingPanelForm, - NSFileHandlingPanelHomeButton, - NSFileHandlingPanelDiskButton, - NSFileHandlingPanelDiskEjectButton -}; - -// -// Scroller -// -typedef enum _NSScrollArrowPosition { - NSScrollerArrowsMaxEnd, - NSScrollerArrowsMinEnd, - NSScrollerArrowsNone -} NSScrollArrowPosition; - -typedef enum _NSScrollerPart { - NSScrollerNoPart, - NSScrollerDecrementPage, - NSScrollerKnob, - NSScrollerIncrementPage, - NSScrollerDecrementLine, - NSScrollerIncrementLine, - NSScrollerKnobSlot -} NSScrollerPart; - -typedef enum _NSScrollerUsablePart { - NSNoScrollerParts, - NSOnlyScrollerArrows, - NSAllScrollerParts -} NSUsableScrollerParts; - -typedef enum _NSScrollerArrow { - NSScrollerIncrementArrow, - NSScrollerDecrementArrow -} NSScrollerArrow; - -const float NSScrollerWidth; - -// -// Text -// -typedef short NSLineDesc; - -typedef struct _NSTextChunk { - short growby; - int allocated; - int used; -} NSTextChunk; - -typedef struct _NSBreakArray { - NSTextChunk chunk; - NSLineDesc breaks[1]; -} NSBreakArray; - -typedef struct _NSCharArray { - NSTextChunk chunk; - unsigned char text[1]; -} NSCharArray; - -typedef unsigned short (*NSCharFilterFunc) (unsigned short charCode, - int flags, - NSStringEncoding theEncoding); - -typedef struct _NSFSM { - const struct _NSFSM *next; - short delta; - short token; -} NSFSM; - -typedef struct _NSHeightInfo { - float newHeight; - float oldHeight; - NSLineDesc lineDesc; -} NSHeightInfo; - -typedef struct _NSHeightChange { - NSLineDesc lineDesc; - NSHeightInfo heightInfo; -} NSHeightChange; - -typedef struct { - unsigned int underline:1; - unsigned int dummy:1; - unsigned int subclassWantsRTF:1; - unsigned int graphic:1; - unsigned int forcedSymbol:1; - unsigned int RESERVED:11; -} NSRunFlags; - -typedef struct _NSRun { - id font; - int chars; - void *paraStyle; - int textRGBColor; - unsigned char superscript; - unsigned char subscript; - id info; - NSRunFlags rFlags; -} NSRun; - -typedef struct { - unsigned int mustMove:1; - unsigned int isMoveChar:1; - unsigned int RESERVED:14; -} NSLayFlags; - -typedef struct _NSLay { - float x; - float y; - short offset; - short chars; - id font; - void *paraStyle; - NSRun *run; - NSLayFlags lFlags; -} NSLay; - -typedef struct _NSLayArray { - NSTextChunk chunk; - NSLay lays[1]; -} NSLayArray; - -typedef struct _NSWidthArray { - NSTextChunk chunk; - float widths[1]; -} NSWidthArray; - -typedef struct _NSTextBlock { - struct _NSTextBlock *next; - struct _NSTextBlock *prior; - struct _tbFlags { - unsigned int malloced:1; - unsigned int PAD:15; - } tbFlags; - short chars; - unsigned char *text; -} NSTextBlock; - -typedef struct _NSTextCache { - int curPos; - NSRun *curRun; - int runFirstPos; - NSTextBlock *curBlock; - int blockFirstPos; -} NSTextCache; - -typedef struct _NSLayInfo { - NSRect rect; - float descent; - float width; - float left; - float right; - float rightIndent; - NSLayArray *lays; - NSWidthArray *widths; - NSCharArray *chars; - NSTextCache cache; - NSRect *textClipRect; - struct _lFlags { - unsigned int horizCanGrow:1; - unsigned int vertCanGrow:1; - unsigned int erase:1; - unsigned int ping:1; - unsigned int endsParagraph:1; - unsigned int resetCache:1; - unsigned int RESERVED:10; - } lFlags; -} NSLayInfo; - -typedef enum _NSParagraphProperty { - NSLeftAlignedParagraph, - NSRightAlignedParagraph, - NSCenterAlignedParagraph, - NSJustificationAlignedParagraph, - NSFirstIndentParagraph, - NSIndentParagraph, - NSAddTabParagraph, - NSRemoveTabParagraph, - NSLeftMarginParagraph, - NSRightMarginParagraph -} NSParagraphProperty; - -typedef struct _NSRunArray { - NSTextChunk chunk; - NSRun runs[1]; -} NSRunArray; - -typedef struct _NSSelPt { - int cp; - int line; - float x; - float y; - int c1st; - float ht; -} NSSelPt; - -typedef struct _NSTabStop { - short kind; - float x; -} NSTabStop; - -typedef char *(*NSTextFilterFunc) (id self, - unsigned char * insertText, - int *insertLength, - int position); - -typedef int (*NSTextFunc) (id self, - NSLayInfo *layInfo); - -typedef enum _NSTextAlignment { - NSLeftTextAlignment, - NSRightTextAlignment, - NSCenterTextAlignment, - NSJustifiedTextAlignment, - NSNaturalTextAlignment -} NSTextAlignment; - -typedef struct _NSTextStyle { - float indent1st; - float indent2nd; - float lineHt; - float descentLine; - NSTextAlignment alignment; - short numTabs; - NSTabStop *tabs; -} NSTextStyle; - -enum { - NSLeftTab -}; - -enum { - NSBackspaceKey = 8, - NSCarriageReturnKey = 13, - NSDeleteKey= 0x7f, - NSBacktabKey = 25 -}; - -enum { - NSIllegalTextMovement = 0, - NSReturnTextMovement = 0x10, - NSTabTextMovement = 0x11, - NSBacktabTextMovement = 0x12, - NSLeftTextMovement = 0x13, - NSRightTextMovement = 0x14, - NSUpTextMovement = 0x15, - NSDownTextMovement = 0x16 -}; - -enum { - NSTextBlockSize = 512 -}; - -// -// Break Tables -// -const NSFSM *NSCBreakTable; -int NSCBreakTableSize; -const NSFSM *NSEnglishBreakTable; -int NSEnglishBreakTableSize; -const NSFSM *NSEnglishNoBreakTable; -int NSEnglishNoBreakTableSize; - -// -// Character Category Tables -// -const unsigned char *NSCCharCatTable; -const unsigned char *NSEnglishCharCatTable; - -// -// Click Tables -// -const NSFSM *NSCClickTable; -int NSCClickTableSize; -const NSFSM *NSEnglishClickTable; -int NSEnglishClickTableSize; - -// -// Smart Cut and Paste Tables -// -const unsigned char *NSCSmartLeftChars; -const unsigned char *NSCSmartRightChars; -const unsigned char *NSEnglishSmartLeftChars; -const unsigned char *NSEnglishSmartRightChars; - -// -// NSCStringText Internal State Structure -// -typedef struct _NSCStringTextInternalState { - const NSFSM *breakTable; - const NSFSM *clickTable; - const unsigned char *preSelSmartTable; - const unsigned char *postSelSmartTable; - const unsigned char *charCategoryTable; - char delegateMethods; - NSCharFilterFunc charFilterFunc; - NSTextFilterFunc textFilterFunc; - NSString *_string; - NSTextFunc scanFunc; - NSTextFunc drawFunc; - id delegate; - int tag; - void *cursorTE; - NSTextBlock *firstTextBlock; - NSTextBlock *lastTextBlock; - NSRunArray *theRuns; - NSRun typingRun; - NSBreakArray *theBreaks; - int growLine; - int textLength; - float maxY; - float maxX; - NSRect bodyRect; - float borderWidth; - char clickCount; - NSSelPt sp0; - NSSelPt spN; - NSSelPt anchorL; - NSSelPt anchorR; - NSSize maxSize; - NSSize minSize; - struct _tFlags { -#ifdef __BIG_ENDIAN__ - unsigned int _editMode:2; - unsigned int _selectMode:2; - unsigned int _caretState:2; - unsigned int changeState:1; - unsigned int charWrap:1; - unsigned int haveDown:1; - unsigned int anchorIs0:1; - unsigned int horizResizable:1; - unsigned int vertResizable:1; - unsigned int overstrikeDiacriticals:1; - unsigned int monoFont:1; - unsigned int disableFontPanel:1; - unsigned int inClipView:1; -#else - unsigned int inClipView:1; - unsigned int disableFontPanel:1; - unsigned int monoFont:1; - unsigned int overstrikeDiacriticals:1; - unsigned int vertResizable:1; - unsigned int horizResizable:1; - unsigned int anchorIs0:1; - unsigned int haveDown:1; - unsigned int charWrap:1; - unsigned int changeState:1; - unsigned int _caretState:2; - unsigned int _selectMode:2; - unsigned int _editMode:2; -#endif - } tFlags; - void *_info; - void *_textStr; -} NSCStringTextInternalState; - -// -// View -// -typedef int NSTrackingRectTag; - -typedef enum _NSBorderType { - NSNoBorder, - NSLineBorder, - NSBezelBorder, - NSGrooveBorder -} NSBorderType; - -enum { - NSViewNotSizable, - NSViewMinXMargin, - NSViewWidthSizable, - NSViewMaxXMargin, - NSViewMinYMargin, - NSViewHeightSizable, - NSViewMaxYMargin -}; - -// -// Window -// -enum { - NSNormalWindowLevel = 0, - NSFloatingWindowLevel = 3, - NSDockWindowLevel = 5, - NSSubmenuWindowLevel = 10, - NSMainMenuWindowLevel = 20 -}; - -enum { - NSBorderlessWindowMask = 1, - NSTitledWindowMask = 2, - NSClosableWindowMask = 4, - NSMiniaturizableWindowMask = 8, - NSResizableWindowMask = 16 -}; - -// -// Size Globals -// -NSSize NSIconSize; -NSSize NSTokenSize; - -// -// Workspace -// - -// -// Workspace File Type Globals -// - -extern NSString *NSPlainFileType; -extern NSString *NSDirectoryFileType; -extern NSString *NSApplicationFileType; -extern NSString *NSFilesystemFileType; -extern NSString *NSShellCommandFileType; - -// -// Workspace File Operation Globals -// -extern NSString *NSWorkspaceCompressOperation; -extern NSString *NSWorkspaceCopyOperation; -extern NSString *NSWorkspaceDecompressOperation; -extern NSString *NSWorkspaceDecryptOperation; -extern NSString *NSWorkspaceDestroyOperation; -extern NSString *NSWorkspaceDuplicateOperation; -extern NSString *NSWorkspaceEncryptOperation; -extern NSString *NSWorkspaceLinkOperation; -extern NSString *NSWorkspaceMoveOperation; -extern NSString *NSWorkspaceRecycleOperation; - -#endif // _GNUstep_H_GUITypes diff --git a/Headers/gnustep/gui/stdappkit.h b/Headers/gnustep/gui/stdappkit.h deleted file mode 100644 index e39f440fe..000000000 --- a/Headers/gnustep/gui/stdappkit.h +++ /dev/null @@ -1,37 +0,0 @@ -/* stdappkit.h - - Global includes for the GNUstep GUI Library. - - Copyright (C) 1996 Free Software Foundation, Inc. - - Author: Scott Christley - Date: 1996 - - This file is part of the GNUstep GUI Library. - - This library is free software; you can redistribute it and/or - modify it under the terms of the GNU Library General Public - License as published by the Free Software Foundation; either - version 2 of the License, or (at your option) any later version. - - This library is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - Library General Public License for more details. - - You should have received a copy of the GNU Library General Public - License along with this library; see the file COPYING.LIB. - If not, write to the Free Software Foundation, - 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. -*/ - -#ifndef _GNUstep_H_AppKitStandard -#define _GNUstep_H_AppKitStandard - -#include - -#include -#include -#include - -#endif // _GNUstep_H_AppKitStandard diff --git a/Images/.cvsignore b/Images/.cvsignore new file mode 100644 index 000000000..f3c7a7c5d --- /dev/null +++ b/Images/.cvsignore @@ -0,0 +1 @@ +Makefile diff --git a/Source/.cvsignore b/Source/.cvsignore new file mode 100644 index 000000000..f3c7a7c5d --- /dev/null +++ b/Source/.cvsignore @@ -0,0 +1 @@ +Makefile diff --git a/Source/Functions.m b/Source/Functions.m index 49b23bfbb..92483fce0 100644 --- a/Source/Functions.m +++ b/Source/Functions.m @@ -26,11 +26,16 @@ 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ -#include -#include #include #include +#include + +#ifndef LIB_FOUNDATION_LIBRARY + +#include +#include + // Should be in Foundation Kit // Does not handle %@ // yuck, yuck, yuck @@ -51,7 +56,18 @@ void NSLog(NSString *format, ...) NSLogV(format, ap); va_end(ap); } +#endif /* LIB_FOUNDATION_LIBRARY */ void NSNullLog(NSString *format, ...) { } + +// +// Play the System Beep +// +void NSBeep(void) +{ +#ifdef WIN32 + MessageBeep(MB_OK); +#endif +} diff --git a/Source/LogFile.m b/Source/LogFile.m index 01896c41a..910cdcad3 100644 --- a/Source/LogFile.m +++ b/Source/LogFile.m @@ -26,7 +26,7 @@ 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ -#include +#include @implementation LogFile @@ -101,6 +101,7 @@ fprintf(the_log, "%s", logEntry); fflush(the_log); } + return self; } - closeLog @@ -108,6 +109,7 @@ [self writeLog:"Log closed.\n"]; if (the_log) fclose(the_log); the_log = NULL; + return self; } - (BOOL)isDateLogging @@ -118,6 +120,7 @@ - setDateLogging:(BOOL)flag { l_flags.is_date_logging = flag; + return self; } - (BOOL)isLocking diff --git a/Source/Makefile.in b/Source/Makefile.in index 0794069f3..1c8cf24f7 100644 --- a/Source/Makefile.in +++ b/Source/Makefile.in @@ -45,12 +45,10 @@ bindir = @bindir@ MAKEDEFINES = -CC = @CC@ +CC = @CC@ -g CPPFLAGS = @CPPFLAGS@ -CFLAGS = -g -O -Wall $(GCCFLAGS) -ALL_CPPFLAGS = $(CPPFLAGS) -I../Headers -ALL_CFLAGS = $(ALL_CPPFLAGS) $(CFLAGS) -DEFS = -DGNUSTEP_INSTALL_LIBDIR=$(gnustep_libdir) @DEFS@ +CFLAGS = -c $(GCCFLAGS) -I../Headers $(CPPFLAGS) +DEFS = -DGNUSTEP_INSTALL_LIBDIR=\"$(gnustep_libdir)\" @DEFS@ GCC_LIB = OBJC_LIB = -lobjc @@ -175,7 +173,7 @@ NSBitmapImageRep$(oext) \ NSBox$(oext) \ NSBrowser$(oext) \ NSBrowserCell$(oext) \ -NSBundle$(oext) \ +NSBundleAdditions$(oext) \ NSButton$(oext) \ NSButtonCell$(oext) \ NSCStringText$(oext) \ @@ -242,9 +240,9 @@ OBJS = $(OBJS_WITHOUT_INIT) .SUFFIXES: .m .m$(oext): - $(CC) -c $(ALL_CFLAGS) $(DEFS) $< + $(CC) $(CFLAGS) $(DEFS) $< .c$(oext): - $(CC) -c $(ALL_CFLAGS) $(DEFS) $< + $(CC) $(CFLAGS) $(DEFS) $< # # libraries @@ -276,7 +274,7 @@ $(MAIN_FILE)$(libext): $(OBJS) $(INIT_FILE_OBJ): $(OBJS_WITHOUT_INIT) nm $(OBJS_WITHOUT_INIT) | grep " __GLOBAL_" > tmpinit.c collect tmpinit.c $(INIT_FILE) - $(CC) $(ALL_CFLAGS) $(INIT_FILE).c + $(CC) $(CFLAGS) $(INIT_FILE).c rm tmpinit.c install: installdirs install-lib install-headers @@ -321,9 +319,6 @@ uninstall: rm -rf $(includedir)/DPSClient rm -rf $(libdir)/$(MAIN_FILE)$(libext) -Makefile: $(srcdir)/Makefile.in ../config.status - cd ..; $(SHELL) config.status - # # Cleaning # diff --git a/Source/NSActionCell.m b/Source/NSActionCell.m index 18c2ab4ee..ca7a50a3e 100644 --- a/Source/NSActionCell.m +++ b/Source/NSActionCell.m @@ -26,9 +26,10 @@ 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ -#include -#include -#include +#include +#include +#include +#include @implementation NSActionCell @@ -151,21 +152,6 @@ // // Manipulating NSActionCell Values // -- (double)doubleValue -{ - return [super doubleValue]; -} - -- (float)floatValue -{ - return [super floatValue]; -} - -- (int)intValue -{ - return [super intValue]; -} - - (void)setStringValue:(NSString *)aString { [super setStringValue:aString]; @@ -174,23 +160,28 @@ [(NSControl *)control_view updateCell: self]; } -- (NSString *)stringValue +- (void)setDoubleValue:(double)aDouble { - return [super stringValue]; + [super setDoubleValue:aDouble]; + if (control_view) + if ([control_view isKindOfClass: [NSControl class]]) + [(NSControl *)control_view updateCell: self]; } -// -// Displaying -// -- (void)drawWithFrame:(NSRect)cellFrame - inView:(NSView *)controlView +- (void)setFloatValue:(float)aFloat { - [super drawWithFrame:cellFrame inView:controlView]; + [super setFloatValue:aFloat]; + if (control_view) + if ([control_view isKindOfClass: [NSControl class]]) + [(NSControl *)control_view updateCell: self]; } -- (NSView *)controlView +- (void)setIntValue:(int)anInt { - return [super controlView]; + [super setIntValue:anInt]; + if (control_view) + if ([control_view isKindOfClass: [NSControl class]]) + [(NSControl *)control_view updateCell: self]; } // @@ -237,8 +228,13 @@ [super encodeWithCoder:aCoder]; [aCoder encodeValueOfObjCType: "i" at: &tag]; +#if 0 [aCoder encodeObjectReference: target withName: @"Target"]; - [aCoder encodeValueOfObjCType: @encode(SEL) at: &action]; +#else + [aCoder encodeConditionalObject:target]; +#endif + + [aCoder encodeValueOfObjCType:@encode(SEL) at: &action]; } - initWithCoder:aDecoder @@ -246,7 +242,11 @@ [super initWithCoder:aDecoder]; [aDecoder decodeValueOfObjCType: "i" at: &tag]; +#if 0 [aDecoder decodeObjectAt: &target withName: NULL]; +#else + target = [aDecoder decodeObject]; +#endif [aDecoder decodeValueOfObjCType: @encode(SEL) at: &action]; return self; diff --git a/Source/NSApplication.m b/Source/NSApplication.m index 527fadd84..195ac056d 100644 --- a/Source/NSApplication.m +++ b/Source/NSApplication.m @@ -26,18 +26,27 @@ 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ -#include -#include -#include #include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + // // Class variables // // The global application instance extern id NSApp; -NSEvent *NullEvent; -BOOL gnustep_gui_app_is_in_dealloc; +NSEvent *NullEvent = NULL; +static BOOL gnustep_gui_app_is_in_dealloc; // Global strings NSString *NSModalPanelRunLoopMode = @"ModalPanelMode"; @@ -152,7 +161,7 @@ NSString *NSApplicationWillUpdateNotification = @"ApplicationWillUpdate"; // Event handling setup // // allocate the event queue - event_queue = [[Queue alloc] init]; + event_queue = [[NSMutableArray alloc] init]; // No current event current_event = nil; // The NULL event @@ -183,8 +192,6 @@ NSString *NSApplicationWillUpdateNotification = @"ApplicationWillUpdate"; - (void)dealloc { - int i, j; - NSDebugLog(@"Freeing NSApplication\n"); // Let ourselves know we are within dealloc @@ -263,7 +270,7 @@ NSString *NSApplicationWillUpdateNotification = @"ApplicationWillUpdate"; e = [self nextEventMatchingMask:NSAnyEventMask untilDate:nil inMode:nil dequeue:YES]; if (e) - [self sendEvent: e]; + [self postEvent:e atStart:YES]; else { // Null event @@ -437,10 +444,10 @@ NSString *NSApplicationWillUpdateNotification = @"ApplicationWillUpdate"; int i, j; // If the queue isn't empty then check those messages - if (![event_queue isEmpty]) + if ([event_queue count]) { j = [event_queue count]; - for (i = j-1;i >= 0; --i) + for (i = j-1;i > 0; --i) { e = [event_queue objectAtIndex: i]; if ([self event: e matchMask: mask]) @@ -469,32 +476,13 @@ NSString *NSApplicationWillUpdateNotification = @"ApplicationWillUpdate"; } } - // Unhide the cursor if necessary - { - NSEventType type; - - // Only if we should unhide when mouse moves - if ([NSCursor isHiddenUntilMouseMoves]) - { - // Make sure the event is a mouse event before unhiding - type = [e type]; - if ((type == NSLeftMouseDown) || (type == NSLeftMouseUp) - || (type == NSRightMouseDown) || (type == NSRightMouseUp) - || (type == NSMouseMoved)) - [NSCursor unhide]; - } - } - [self setCurrentEvent: e]; return e; } - (void)postEvent:(NSEvent *)event atStart:(BOOL)flag { - if (flag) - [event_queue appendObject: event]; - else - [event_queue enqueueObject: event]; + [self sendEvent:event]; } // @@ -713,7 +701,6 @@ NSString *NSApplicationWillUpdateNotification = @"ApplicationWillUpdate"; int i, j; NSMenuCell *mc; NSArray *mi; - id w; // Release old and retain new [main_menu release]; @@ -779,9 +766,6 @@ NSString *NSApplicationWillUpdateNotification = @"ApplicationWillUpdate"; - (void)removeWindowsItem:aWindow { - int i, j; - id w; - // +++ This should be different if (aWindow == key_window) key_window = nil; @@ -875,7 +859,7 @@ NSString *NSApplicationWillUpdateNotification = @"ApplicationWillUpdate"; { BOOL result = NO; - if ([delegate respondsTo:@selector(application:openFileWithoutUI:)]) + if ([delegate respondsToSelector:@selector(application:openFileWithoutUI:)]) result = [delegate application:sender openFileWithoutUI:filename]; return result; @@ -885,7 +869,7 @@ NSString *NSApplicationWillUpdateNotification = @"ApplicationWillUpdate"; { BOOL result = NO; - if ([delegate respondsTo:@selector(application:openFile:)]) + if ([delegate respondsToSelector:@selector(application:openFile:)]) result = [delegate application:app openFile:filename]; return result; @@ -895,7 +879,7 @@ NSString *NSApplicationWillUpdateNotification = @"ApplicationWillUpdate"; { BOOL result = NO; - if ([delegate respondsTo:@selector(application:openTempFile:)]) + if ([delegate respondsToSelector:@selector(application:openTempFile:)]) result = [delegate application:app openTempFile:filename]; return result; @@ -903,37 +887,37 @@ NSString *NSApplicationWillUpdateNotification = @"ApplicationWillUpdate"; - (void)applicationDidBecomeActive:(NSNotification *)aNotification { - if ([delegate respondsTo:@selector(applicationDidBecomeActive:)]) + if ([delegate respondsToSelector:@selector(applicationDidBecomeActive:)]) [delegate applicationDidBecomeActive:aNotification]; } - (void)applicationDidFinishLaunching:(NSNotification *)aNotification { - if ([delegate respondsTo:@selector(applicationDidFinishLaunching:)]) + if ([delegate respondsToSelector:@selector(applicationDidFinishLaunching:)]) [delegate applicationDidFinishLaunching:aNotification]; } - (void)applicationDidHide:(NSNotification *)aNotification { - if ([delegate respondsTo:@selector(applicationDidHide:)]) + if ([delegate respondsToSelector:@selector(applicationDidHide:)]) [delegate applicationDidHide:aNotification]; } - (void)applicationDidResignActive:(NSNotification *)aNotification { - if ([delegate respondsTo:@selector(applicationDidResignActive:)]) + if ([delegate respondsToSelector:@selector(applicationDidResignActive:)]) [delegate applicationDidResignActive:aNotification]; } - (void)applicationDidUnhide:(NSNotification *)aNotification { - if ([delegate respondsTo:@selector(applicationDidUnhide:)]) + if ([delegate respondsToSelector:@selector(applicationDidUnhide:)]) [delegate applicationDidUnhide:aNotification]; } - (void)applicationDidUpdate:(NSNotification *)aNotification { - if ([delegate respondsTo:@selector(applicationDidUpdate:)]) + if ([delegate respondsToSelector:@selector(applicationDidUpdate:)]) [delegate applicationDidUpdate:aNotification]; } @@ -941,7 +925,7 @@ NSString *NSApplicationWillUpdateNotification = @"ApplicationWillUpdate"; { BOOL result = NO; - if ([delegate respondsTo:@selector(applicationOpenUntitledFile:)]) + if ([delegate respondsToSelector:@selector(applicationOpenUntitledFile:)]) result = [delegate applicationOpenUntitledFile:app]; return result; @@ -951,7 +935,7 @@ NSString *NSApplicationWillUpdateNotification = @"ApplicationWillUpdate"; { BOOL result = YES; - if ([delegate respondsTo:@selector(applicationShouldTerminate:)]) + if ([delegate respondsToSelector:@selector(applicationShouldTerminate:)]) result = [delegate applicationShouldTerminate:sender]; return result; @@ -959,37 +943,37 @@ NSString *NSApplicationWillUpdateNotification = @"ApplicationWillUpdate"; - (void)applicationWillBecomeActive:(NSNotification *)aNotification { - if ([delegate respondsTo:@selector(applicationWillBecomeActive:)]) + if ([delegate respondsToSelector:@selector(applicationWillBecomeActive:)]) [delegate applicationWillBecomeActive:aNotification]; } - (void)applicationWillFinishLaunching:(NSNotification *)aNotification { - if ([delegate respondsTo:@selector(applicationWillFinishLaunching:)]) + if ([delegate respondsToSelector:@selector(applicationWillFinishLaunching:)]) [delegate applicationWillFinishLaunching:aNotification]; } - (void)applicationWillHide:(NSNotification *)aNotification { - if ([delegate respondsTo:@selector(applicationWillHide:)]) + if ([delegate respondsToSelector:@selector(applicationWillHide:)]) [delegate applicationWillHide:aNotification]; } - (void)applicationWillResignActive:(NSNotification *)aNotification { - if ([delegate respondsTo:@selector(applicationWillResignActive:)]) + if ([delegate respondsToSelector:@selector(applicationWillResignActive:)]) [delegate applicationWillResignActive:aNotification]; } - (void)applicationWillUnhide:(NSNotification *)aNotification { - if ([delegate respondsTo:@selector(applicationWillUnhide:)]) + if ([delegate respondsToSelector:@selector(applicationWillUnhide:)]) [delegate applicationWillUnhide:aNotification]; } - (void)applicationWillUpdate:(NSNotification *)aNotification { - if ([delegate respondsTo:@selector(applicationWillUpdate:)]) + if ([delegate respondsToSelector:@selector(applicationWillUpdate:)]) [delegate applicationWillUpdate:aNotification]; } @@ -1004,11 +988,19 @@ NSString *NSApplicationWillUpdateNotification = @"ApplicationWillUpdate"; // We don't want to code the event queue do we? //[aCoder encodeObject: event_queue]; //[aCoder encodeObject: current_event]; +#if 0 [aCoder encodeObjectReference: key_window withName: @"Key window"]; [aCoder encodeObjectReference: main_window withName: @"Main window"]; [aCoder encodeObjectReference: delegate withName: @"Delegate"]; [aCoder encodeObject: main_menu]; [aCoder encodeObjectReference: windows_menu withName: @"Windows menu"]; +#else + [aCoder encodeConditionalObject:key_window]; + [aCoder encodeConditionalObject:main_window]; + [aCoder encodeConditionalObject:delegate]; + [aCoder encodeObject:main_menu]; + [aCoder encodeConditionalObject:windows_menu]; +#endif } - initWithCoder:aDecoder @@ -1016,11 +1008,19 @@ NSString *NSApplicationWillUpdateNotification = @"ApplicationWillUpdate"; [super initWithCoder:aDecoder]; window_list = [aDecoder decodeObject]; +#if 0 [aDecoder decodeObjectAt: &key_window withName: NULL]; [aDecoder decodeObjectAt: &main_window withName: NULL]; [aDecoder decodeObjectAt: &delegate withName: NULL]; main_menu = [aDecoder decodeObject]; [aDecoder decodeObjectAt: &windows_menu withName: NULL]; +#else + key_window = [aDecoder decodeObject]; + main_window = [aDecoder decodeObject]; + delegate = [aDecoder decodeObject]; + main_menu = [aDecoder decodeObject]; + windows_menu = [aDecoder decodeObject]; +#endif return self; } @@ -1036,7 +1036,7 @@ NSString *NSApplicationWillUpdateNotification = @"ApplicationWillUpdate"; // Get next event - (NSEvent *)getNextEvent { - [event_queue enqueueObject: NullEvent]; + [event_queue addObject: NullEvent]; return NullEvent; } diff --git a/Source/NSBitmapImageRep.m b/Source/NSBitmapImageRep.m index dffafd35a..a43e56ab6 100644 --- a/Source/NSBitmapImageRep.m +++ b/Source/NSBitmapImageRep.m @@ -28,10 +28,16 @@ #include #include +#include + #include #include #include +#include +#include #include +#include +#include /* Maximum number of planes */ #define MAX_PLANES 5 diff --git a/Source/NSBox.m b/Source/NSBox.m index 4151f76b1..800ef4967 100644 --- a/Source/NSBox.m +++ b/Source/NSBox.m @@ -26,8 +26,9 @@ 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ -#include -#include +#include +#include +#include @implementation NSBox diff --git a/Source/NSBrowser.m b/Source/NSBrowser.m index 4645327ab..3887882be 100644 --- a/Source/NSBrowser.m +++ b/Source/NSBrowser.m @@ -26,7 +26,7 @@ 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ -#include +#include @implementation NSBrowser diff --git a/Source/NSBrowserCell.m b/Source/NSBrowserCell.m index 19f8d1035..57ee8b0a5 100644 --- a/Source/NSBrowserCell.m +++ b/Source/NSBrowserCell.m @@ -26,7 +26,7 @@ 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ -#include +#include @implementation NSBrowserCell diff --git a/Source/NSBundle.m b/Source/NSBundleAdditions.m similarity index 89% rename from Source/NSBundle.m rename to Source/NSBundleAdditions.m index 359d3387e..472d5e745 100644 --- a/Source/NSBundle.m +++ b/Source/NSBundleAdditions.m @@ -26,7 +26,7 @@ */ #include -#include +#include @implementation NSBundle (NSBundleAdditions) @@ -37,7 +37,7 @@ + (BOOL)loadNibFile:(NSString *)fileName externalNameTable:(NSDictionary *)context -withZone:(NSZone *)zone + withZone:(NSZone *)zone { return NO; } @@ -49,3 +49,10 @@ withZone:(NSZone *)zone } @end + +@interface __dummy_class_in_NSBundle +@end + +@implementation __dummy_class_in_NSBundle +@end + diff --git a/Source/NSButton.m b/Source/NSButton.m index 9da09212d..e1cc80460 100644 --- a/Source/NSButton.m +++ b/Source/NSButton.m @@ -26,15 +26,16 @@ 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ -#include -#include -#include -#include +#include +#include +#include +#include +#include // // class variables // -id MB_NSBUTTON_CLASS; +static id MB_NSBUTTON_CLASS = nil; // // NSButton implementation @@ -94,9 +95,9 @@ id MB_NSBUTTON_CLASS; // // Setting the Button Type // -- (void)setType:(NSButtonType)aType +- (void)setButtonType:(NSButtonType)aType { - [cell setType:aType]; + [cell setButtonType:aType]; [self display]; } @@ -111,6 +112,21 @@ id MB_NSBUTTON_CLASS; // // Setting the State // +- (void)setIntValue:(int)anInt +{ + [self setState:(anInt != 0)]; +} + +- (void)setFloatValue:(float)aFloat +{ + [self setState:(aFloat != 0)]; +} + +- (void)setDoubleValue:(double)aDouble +{ + [self setState:(aDouble != 0)]; +} + - (void)setState:(int)value { [cell setState:value]; @@ -194,6 +210,16 @@ id MB_NSBUTTON_CLASS; [self display]; } +- (void)setAlignment:(NSTextAlignment)mode +{ + [cell setAlignment:mode]; +} + +- (NSTextAlignment)alignment +{ + return [cell alignment]; +} + // // Modifying Graphic Attributes // @@ -270,6 +296,7 @@ id MB_NSBUTTON_CLASS; // capture mouse [[self window] captureMouse: self]; + [self lockFocus]; done = NO; e = theEvent; @@ -300,6 +327,7 @@ id MB_NSBUTTON_CLASS; [cell highlight: NO withFrame: bounds inView: self]; +#if 0 // // Perform different state changes based upon our type // @@ -326,11 +354,18 @@ id MB_NSBUTTON_CLASS; [cell setState:1]; NSDebugLog(@"toggle state on\n"); } + default: + break; } +#endif + [cell setState:![self state]]; // Have the target perform the action [self sendAction:[self action] to:[self target]]; + + [cell drawWithFrame:bounds inView:self]; } + [self unlockFocus]; } - (void)performClick:(id)sender diff --git a/Source/NSButtonCell.m b/Source/NSButtonCell.m index c2e020069..b53806b2b 100644 --- a/Source/NSButtonCell.m +++ b/Source/NSButtonCell.m @@ -26,13 +26,15 @@ 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ -#include -#include -#include #include #include -#include -#include +#include +#include +#include +#include +#include +#include +#include // // NSButtonCell implementation @@ -56,17 +58,17 @@ // - init { - [self initTextCell:[NSString stringWithCString:"Button"]]; + [self initTextCell:@"Button"]; return self; } - initImageCell:(NSImage *)anImage { [super initImageCell:anImage]; - contents = @"Button"; - cell_type = NSMomentaryPushButton; + [self setStringValue:@"Button"]; + [self setButtonType:NSMomentaryPushButton]; [self setEnabled:YES]; - transparent = NO; + [self setTransparent:NO]; [self setBordered:YES]; return self; } @@ -74,16 +76,20 @@ - initTextCell:(NSString *)aString { [super initTextCell:aString]; - alt_contents = @"Button"; - cell_type = NSMomentaryPushButton; + altContents = @"Button"; + [self setButtonType:NSMomentaryPushButton]; [self setEnabled:YES]; - transparent = NO; + [self setTransparent:NO]; [self setBordered:YES]; return self; } - (void)dealloc { + [altContents release]; + [altImage release]; + [keyEquivalent release]; + [keyEquivalentFont release]; [super dealloc]; } @@ -92,12 +98,12 @@ // - (NSString *)alternateTitle { - return alt_contents; + return altContents; } - (void)setAlternateTitle:(NSString *)aString { - alt_contents = aString; + altContents = [aString copy]; // update our state [self setState:[self state]]; } @@ -124,7 +130,7 @@ // - (NSImage *)alternateImage { - return alt_image; + return altImage; } - (NSCellImagePosition)imagePosition @@ -134,7 +140,7 @@ - (void)setAlternateImage:(NSImage *)anImage { - alt_image = anImage; + altImage = [anImage retain]; } - (void)setImagePosition:(NSCellImagePosition)aPosition @@ -158,40 +164,43 @@ // - (NSString *)keyEquivalent { - return nil; + return keyEquivalent; } - (NSFont *)keyEquivalentFont { - return nil; + return keyEquivalentFont; } - (unsigned int)keyEquivalentModifierMask { - return 0; + return keyEquivalentModifierMask; } -- (void)setKeyEquivalent:(NSString *)aKeyEquivalent -{} +- (void)setKeyEquivalent:(NSString *)key +{ + keyEquivalent = [key copy]; +} - (void)setKeyEquivalentModifierMask:(unsigned int)mask -{} +{ + keyEquivalentModifierMask = mask; +} - (void)setKeyEquivalentFont:(NSFont *)fontObj -{} +{ + keyEquivalentFont = [fontObj retain]; +} - (void)setKeyEquivalentFont:(NSString *)fontName size:(float)fontSize -{} +{ + keyEquivalentFont = [[NSFont fontWithName:fontName size:fontSize] retain]; +} // // Modifying Graphic Attributes // -- (BOOL)isOpaque -{ - return NO; -} - - (BOOL)isTransparent { return transparent; @@ -202,23 +211,64 @@ transparent = flag; } +- (BOOL)isOpaque +{ + return !transparent && [self isBordered]; +} + // // Modifying Graphic Attributes // - (int)highlightsBy { - return 0; + return highlightsByMask; } -- (void)setHighlightsBy:(int)aType -{} - -- (void)setShowsStateBy:(int)aType -{} - -- (void)setType:(NSButtonType)aType +- (void)setHighlightsBy:(int)mask { - cell_type = aType; + highlightsByMask = mask; +} + +- (void)setShowsStateBy:(int)mask +{ + showAltStateMask = mask; +} + +- (void)setButtonType:(NSButtonType)buttonType +{ + [super setType:buttonType]; + + switch (buttonType) { + case NSMomentaryLight: + [self setHighlightsBy:NSChangeBackgroundCellMask]; + [self setShowsStateBy:NSNoCellMask]; + break; + case NSMomentaryPushButton: + [self setHighlightsBy:NSPushInCellMask | NSChangeGrayCellMask]; + [self setShowsStateBy:NSNoCellMask]; + break; + case NSMomentaryChangeButton: + [self setHighlightsBy:NSContentsCellMask]; + [self setShowsStateBy:NSNoCellMask]; + break; + case NSPushOnPushOffButton: + [self setHighlightsBy:NSPushInCellMask | NSChangeGrayCellMask]; + [self setShowsStateBy:NSChangeBackgroundCellMask]; + break; + case NSOnOffButton: + [self setHighlightsBy:NSChangeBackgroundCellMask]; + [self setShowsStateBy:NSChangeBackgroundCellMask]; + break; + case NSToggleButton: + [self setHighlightsBy:NSPushInCellMask | NSContentsCellMask]; + [self setShowsStateBy:NSContentsCellMask]; + break; + case NSSwitchButton: + case NSRadioButton: + [self setHighlightsBy:NSContentsCellMask]; + [self setShowsStateBy:NSContentsCellMask]; + break; + } // update our state [self setState:[self state]]; @@ -226,14 +276,28 @@ - (int)showsStateBy { - return 0; + return showAltStateMask; } -- (void)setState:(int)value +- (void)setIntValue:(int)anInt { - [super setState:value]; + [self setState:(anInt != 0)]; } +- (void)setFloatValue:(float)aFloat +{ + [self setState:(aFloat != 0)]; +} + +- (void)setDoubleValue:(double)aDouble +{ + [self setState:(aDouble != 0)]; +} + +- (int)intValue { return [self state]; } +- (float)floatValue { return [self state]; } +- (double)doubleValue { return [self state]; } + // // Displaying // @@ -259,8 +323,8 @@ [super encodeWithCoder:aCoder]; NSDebugLog(@"NSButtonCell: start encoding\n"); - [aCoder encodeObject: alt_contents]; - [aCoder encodeObject: alt_image]; + [aCoder encodeObject: altContents]; + [aCoder encodeObject: altImage]; [aCoder encodeValueOfObjCType: @encode(BOOL) at: &transparent]; NSDebugLog(@"NSButtonCell: finish encoding\n"); } @@ -270,8 +334,8 @@ [super initWithCoder:aDecoder]; NSDebugLog(@"NSButtonCell: start decoding\n"); - alt_contents = [aDecoder decodeObject]; - alt_image = [aDecoder decodeObject]; + altContents = [aDecoder decodeObject]; + altImage = [aDecoder decodeObject]; [aDecoder decodeValueOfObjCType: @encode(BOOL) at: &transparent]; NSDebugLog(@"NSButtonCell: finish decoding\n"); return self; diff --git a/Source/NSCStringText.m b/Source/NSCStringText.m index 95090f496..b34439887 100644 --- a/Source/NSCStringText.m +++ b/Source/NSCStringText.m @@ -25,9 +25,9 @@ Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. */ -#include -#include #include +#include +#include // // NSCStringText implementation diff --git a/Source/NSCell.m b/Source/NSCell.m index fd513046e..c6194d49e 100644 --- a/Source/NSCell.m +++ b/Source/NSCell.m @@ -26,9 +26,14 @@ 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ -#include -#include -#include +#include +#include +#include +#include +#include +#include +#include +#include @implementation NSCell @@ -92,7 +97,7 @@ cell_type = NSImageCellType; cell_image = anImage; image_position = NSImageOnly; - cell_font = [NSFont userFontOfSize:12]; + cell_font = [[NSFont userFontOfSize:12] retain]; cell_state = NO; cell_highlighted = NO; cell_enabled = YES; @@ -116,7 +121,7 @@ //if (![aString isKindOfClass:[NSString class]]) // return nil; - cell_font = [NSFont userFontOfSize:12]; + cell_font = [[NSFont userFontOfSize:12] retain]; contents = aString; cell_type = NSTextCellType; text_align = NSLeftTextAlignment; @@ -137,6 +142,14 @@ return self; } +- (void)dealloc +{ + [contents release]; + [cell_image release]; + [cell_font release]; + [super dealloc]; +} + // // Determining Component Sizes // @@ -222,7 +235,7 @@ return; // Only set the image if we are an image cell - cell_image = anImage; + cell_image = [anImage retain]; } // @@ -245,48 +258,28 @@ - (NSString *)stringValue { - return [NSString stringWithCString: [contents cString]]; + return contents; } - (void)setDoubleValue:(double)aDouble { - char c[256]; - unsigned int w = cell_float_left + cell_float_right; + NSNumber* number = [NSNumber numberWithDouble:aDouble]; - // Default printf formatting - if (cell_float_left == 0) - sprintf(c, "%f", aDouble); - else - if (cell_float_autorange) - sprintf(c, "%*f", w, aDouble); - else - sprintf(c, "%*.*f", w, cell_float_right, aDouble); - - contents = [NSString stringWithCString:c]; + contents = [[number stringValue] retain]; } - (void)setFloatValue:(float)aFloat { - char c[256]; - unsigned int w = cell_float_left + cell_float_right; + NSNumber* number = [NSNumber numberWithFloat:aFloat]; - // Default printf formatting - if (cell_float_left == 0) - sprintf(c, "%f", aFloat); - else - if (cell_float_autorange) - sprintf(c, "%*f", w, aFloat); - else - sprintf(c, "%*.*f", w, cell_float_right, aFloat); - - contents = [NSString stringWithCString:c]; + contents = [[number stringValue] retain]; } - (void)setIntValue:(int)anInt { - char c[256]; - sprintf(c, "%d", anInt); - contents = [NSString stringWithCString:c]; + NSNumber* number = [NSNumber numberWithInt:anInt]; + + contents = [[number stringValue] retain]; } - (void)setStringValue:(NSString *)aString @@ -294,7 +287,7 @@ if (!aString) contents = @""; else - contents = [NSString stringWithCString: [aString cString]]; + contents = [aString copy]; } // @@ -367,7 +360,7 @@ if (![fontObject isKindOfClass:[NSFont class]]) return; - cell_font = fontObject; + cell_font = [fontObject retain]; } - (void)setSelectable:(BOOL)flag @@ -618,8 +611,7 @@ NSPoint point = [controlView convertPoint: location fromView: nil]; NSPoint last_point; BOOL done; - NSRect r; - BOOL untilMU, mouseWentUp; + BOOL mouseWentUp; NSDebugLog(@"NSCell start tracking\n"); NSDebugLog(@"NSCell tracking in rect %f %f %f %f\n", @@ -645,8 +637,11 @@ last_point = point; e = [theApp nextEventMatchingMask:event_mask untilDate:nil inMode:nil dequeue:YES]; + // What is going on here? After the following statement location + // should be in the window coordinates, but is in the receiving + // view's coordinate. location = [e locationInWindow]; - point = [controlView convertPoint: location fromView: nil]; + // point = [controlView convertPoint: location fromView: nil]; NSDebugLog(@"NSCell location %f %f\n", location.x, location.y); NSDebugLog(@"NSCell point %f %f\n", point.x, point.y); @@ -733,8 +728,6 @@ // - (void)encodeWithCoder:aCoder { - [super encodeWithCoder:aCoder]; - [aCoder encodeObject: contents]; [aCoder encodeObject: cell_image]; [aCoder encodeObject: cell_font]; @@ -754,13 +747,15 @@ [aCoder encodeValueOfObjCType: "i" at: &cell_type]; [aCoder encodeValueOfObjCType: @encode(NSTextAlignment) at: &text_align]; [aCoder encodeValueOfObjCType: "i" at: &entry_type]; +#if 0 [aCoder encodeObjectReference: control_view withName: @"Control view"]; +#else + [aCoder encodeConditionalObject:control_view]; +#endif } - initWithCoder:aDecoder { - [super initWithCoder:aDecoder]; - contents = [aDecoder decodeObject]; cell_image = [aDecoder decodeObject]; cell_font = [aDecoder decodeObject]; @@ -780,8 +775,11 @@ [aDecoder decodeValueOfObjCType: "i" at: &cell_type]; [aDecoder decodeValueOfObjCType: @encode(NSTextAlignment) at: &text_align]; [aDecoder decodeValueOfObjCType: "i" at: &entry_type]; +#if 0 [aDecoder decodeObjectAt: &control_view withName: NULL]; - +#else + control_view = [aDecoder decodeObject]; +#endif return self; } diff --git a/Source/NSClipView.m b/Source/NSClipView.m index ba4c07228..5e08b8ef9 100644 --- a/Source/NSClipView.m +++ b/Source/NSClipView.m @@ -26,7 +26,7 @@ 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ -#include +#include @implementation NSClipView diff --git a/Source/NSColor.m b/Source/NSColor.m index c0541914f..508bf5608 100644 --- a/Source/NSColor.m +++ b/Source/NSColor.m @@ -26,9 +26,9 @@ 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ -#include -#include -#include +#include +#include +#include // Class variables static BOOL gnustep_gui_ignores_alpha = YES; @@ -582,8 +582,6 @@ const float NSWhite = 1; // - (void)encodeWithCoder:aCoder { - [super encodeWithCoder:aCoder]; - // Version 1 [aCoder encodeValueOfObjCType: "f" at: &RGB_component.red]; [aCoder encodeValueOfObjCType: "f" at: &RGB_component.green]; @@ -609,7 +607,6 @@ const float NSWhite = 1; - initWithCoder:aDecoder { NSString *s; - [super initWithCoder:aDecoder]; // Version 1 [aDecoder decodeValueOfObjCType: "f" at: &RGB_component.red]; @@ -619,7 +616,7 @@ const float NSWhite = 1; [aDecoder decodeValueOfObjCType: @encode(BOOL) at: &is_clear]; // Get our class name - s = [NSString stringWithCString: object_get_class_name(self)]; + s = NSStringFromClass(isa); // Version 2 // +++ Coding cannot return class version yet diff --git a/Source/NSColorList.m b/Source/NSColorList.m index 4e51bc32a..c0e9ae7bf 100644 --- a/Source/NSColorList.m +++ b/Source/NSColorList.m @@ -26,11 +26,13 @@ 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ -#include #include #include +#include #include #include +#include +#include // NSColorList notifications NSString *NSColorListChangedNotification = @"NSColorListChange"; @@ -86,7 +88,8 @@ static NSLock *gnustep_color_list_lock; // + (NSColorList *)colorListNamed:(NSString *)name { - id o, e; + id e; + NSColorList* o; BOOL found = NO; // Serialize access to color list @@ -288,7 +291,6 @@ static NSLock *gnustep_color_list_lock; // - (void)encodeWithCoder:aCoder { - [super encodeWithCoder:aCoder]; [aCoder encodeObject: list_name]; [aCoder encodeObject: color_list]; [aCoder encodeObject: color_list_keys]; @@ -297,7 +299,6 @@ static NSLock *gnustep_color_list_lock; - initWithCoder:aDecoder { - [super initWithCoder:aDecoder]; list_name = [aDecoder decodeObject]; color_list = [aDecoder decodeObject]; color_list_keys = [aDecoder decodeObject]; diff --git a/Source/NSColorPanel.m b/Source/NSColorPanel.m index 5e94adf9e..764df6f61 100644 --- a/Source/NSColorPanel.m +++ b/Source/NSColorPanel.m @@ -26,10 +26,10 @@ 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ -#include +#include // NSColorPanel notifications -NSString *NSColorPanelColorChangedNotification; +NSString *NSColorPanelColorChangedNotification = @"NSColorPanelColorChangedNotification"; @implementation NSColorPanel diff --git a/Source/NSColorPicker.m b/Source/NSColorPicker.m index d455e28d4..744e532ae 100644 --- a/Source/NSColorPicker.m +++ b/Source/NSColorPicker.m @@ -26,7 +26,7 @@ 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ -#include +#include @implementation NSColorPicker diff --git a/Source/NSColorWell.m b/Source/NSColorWell.m index 77b72a85c..150dc0eb9 100644 --- a/Source/NSColorWell.m +++ b/Source/NSColorWell.m @@ -26,7 +26,7 @@ 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ -#include +#include @implementation NSColorWell @@ -45,30 +45,14 @@ // // Instance methods // -- initWithFrame:(NSRect)frameRect -{ - [super initWithFrame: frameRect]; - - is_bordered = YES; - is_active = NO; - the_color = [NSColor blackColor]; - - return self; -} // // Drawing // - (void)drawRect:(NSRect)rect { - NSLog(@"NSColorWell drawRect: %f %f %f %f\n", rect.origin.x, rect.origin.y, - rect.size.width, rect.size.height); + // xxx Draw border - // Draw border - if (is_bordered) - [self drawBorderRect: rect]; - - // Draw the color inside [self drawWellInside: rect]; } @@ -149,14 +133,3 @@ } @end - -// -// GNUstep backend methods -// -@implementation NSColorWell (GNUstepBackend) - -- (void)drawBorderRect:(NSRect)aRect -{ -} - -@end diff --git a/Source/NSControl.m b/Source/NSControl.m index 345e3f9fd..1c5d51ebf 100644 --- a/Source/NSControl.m +++ b/Source/NSControl.m @@ -26,18 +26,20 @@ 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ -#include -#include +#include +#include +#include +#include // // Class variables // -id MB_NSCONTROL_CELL_CLASS; +static id MB_NSCONTROL_CELL_CLASS = nil; // NSControl notifications -NSString *NSControlTextDidBeginEditingNotification; -NSString *NSControlTextDidEndEditingNotification; -NSString *NSControlTextDidChangeNotification; +NSString *NSControlTextDidBeginEditingNotification = @"NSControlTextDidBeginEditingNotification"; +NSString *NSControlTextDidEndEditingNotification = @"NSControlTextDidEndEditingNotification"; +NSString *NSControlTextDidChangeNotification = @"NSControlTextDidChangeNotification"; @implementation NSControl @@ -103,7 +105,7 @@ NSString *NSControlTextDidChangeNotification; - copyWithZone:(NSZone *)zone { id c; - c = [super copyWithZone: zone]; + c = NSAllocateObject (isa, 0, zone); NSLog(@"NSControl: copyWithZone\n"); diff --git a/Source/NSCursor.m b/Source/NSCursor.m index c8836c0ca..7a21eb79e 100644 --- a/Source/NSCursor.m +++ b/Source/NSCursor.m @@ -26,7 +26,7 @@ 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ -#include +#include #include // Class variables diff --git a/Source/NSDPSContext.m b/Source/NSDPSContext.m index 7c08654bb..4b006fb37 100644 --- a/Source/NSDPSContext.m +++ b/Source/NSDPSContext.m @@ -26,36 +26,38 @@ 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ -#include #include #include +#include #include +#include +#include // // DPS exceptions // -NSString *DPSPostscriptErrorException; -NSString *DPSNameTooLongException; -NSString *DPSResultTagCheckException; -NSString *DPSResultTypeCheckException; -NSString *DPSInvalidContextException; -NSString *DPSSelectException; -NSString *DPSConnectionClosedException; -NSString *DPSReadException; -NSString *DPSWriteException; -NSString *DPSInvalidFDException; -NSString *DPSInvalidTEException; -NSString *DPSInvalidPortException; -NSString *DPSOutOfMemoryException; -NSString *DPSCantConnectException; +NSString *DPSPostscriptErrorException = @"DPSPostscriptErrorException"; +NSString *DPSNameTooLongException = @"DPSNameTooLongException"; +NSString *DPSResultTagCheckException = @"DPSResultTagCheckException"; +NSString *DPSResultTypeCheckException = @"DPSResultTypeCheckException"; +NSString *DPSInvalidContextException = @"DPSInvalidContextException"; +NSString *DPSSelectException = @"DPSSelectException"; +NSString *DPSConnectionClosedException = @"DPSConnectionClosedException"; +NSString *DPSReadException = @"DPSReadException"; +NSString *DPSWriteException = @"DPSWriteException"; +NSString *DPSInvalidFDException = @"DPSInvalidFDException"; +NSString *DPSInvalidTEException = @"DPSInvalidTEException"; +NSString *DPSInvalidPortException = @"DPSInvalidPortException"; +NSString *DPSOutOfMemoryException = @"DPSOutOfMemoryException"; +NSString *DPSCantConnectException = @"DPSCantConnectException"; // // Class variables // -NSMutableDictionary *GNU_CONTEXT_THREAD_DICT; -NSRecursiveLock *GNU_CONTEXT_LOCK; -BOOL GNU_CONTEXT_TRACED; -BOOL GNU_CONTEXT_SYNCHRONIZED; +static NSMutableDictionary *GNU_CONTEXT_THREAD_DICT = nil; +static NSRecursiveLock *GNU_CONTEXT_LOCK = nil; +static BOOL GNU_CONTEXT_TRACED = NO; +static BOOL GNU_CONTEXT_SYNCHRONIZED = NO; @implementation NSDPSContext @@ -132,9 +134,11 @@ BOOL GNU_CONTEXT_SYNCHRONIZED; // + (NSDPSContext *)currentContext { - NSThread *current_thread = [NSThread currentThread]; + NSThread *current_thread; NSDPSContext *current_context = nil; + current_thread = [NSThread currentThread]; + // Get current context for current thread [GNU_CONTEXT_LOCK lock]; diff --git a/Source/NSDataLink.m b/Source/NSDataLink.m index 35ae89891..32425be95 100644 --- a/Source/NSDataLink.m +++ b/Source/NSDataLink.m @@ -26,8 +26,8 @@ 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ -#include -#include +#include +#include // Global strings NSString *NSDataLinkFileNameExtension = @"dlf"; @@ -188,13 +188,10 @@ supportingTypes:(NSArray *)newTypes // - (void)encodeWithCoder:aCoder { - [super encodeWithCoder:aCoder]; } - initWithCoder:aDecoder { - [super initWithCoder:aDecoder]; - return self; } diff --git a/Source/NSDataLinkManager.m b/Source/NSDataLinkManager.m index e2a0f151a..c3312d89c 100644 --- a/Source/NSDataLinkManager.m +++ b/Source/NSDataLinkManager.m @@ -26,7 +26,7 @@ 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ -#include +#include @implementation NSDataLinkManager @@ -237,13 +237,10 @@ cheapCopyAllowed:(BOOL)flag // - (void)encodeWithCoder:aCoder { - [super encodeWithCoder:aCoder]; } - initWithCoder:aDecoder { - [super initWithCoder:aDecoder]; - return self; } diff --git a/Source/NSDataLinkPanel.m b/Source/NSDataLinkPanel.m index 9fcdf8c74..9752057a2 100644 --- a/Source/NSDataLinkPanel.m +++ b/Source/NSDataLinkPanel.m @@ -26,7 +26,7 @@ 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ -#include +#include @implementation NSDataLinkPanel diff --git a/Source/NSEvent.m b/Source/NSEvent.m index 57fa651e3..b7fe224fe 100644 --- a/Source/NSEvent.m +++ b/Source/NSEvent.m @@ -26,8 +26,9 @@ 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ -#include -#include +#include +#include +#include @implementation NSEvent @@ -163,8 +164,7 @@ e = [[[NSEvent alloc] init] autorelease]; // Make sure it is one of the right event types - if ((type != NSMouseEntered) && (type != NSMouseExited) - && (type != NSCursorUpdate)) + if ((type != NSMouseEntered) && (type != NSMouseExited)) return nil; // Set the event fields @@ -265,7 +265,8 @@ e = [[[NSEvent alloc] init] autorelease]; // Make sure it is one of the right event types - if ((type != NSFlagsChanged) && (type != NSPeriodic)) + if ((type != NSFlagsChanged) && (type != NSCursorUpdate) && + (type != NSPeriodic)) return nil; // Set the event fields @@ -428,8 +429,7 @@ // - (int)trackingNumber { - if ((event_type != NSMouseEntered) && (event_type != NSMouseExited) - && (event_type != NSCursorUpdate)) + if ((event_type != NSMouseEntered) && (event_type != NSMouseExited)) return 0; return event_data.tracking.tracking_num; @@ -437,8 +437,7 @@ - (void *)userData { - if ((event_type != NSMouseEntered) && (event_type != NSMouseExited) - && (event_type != NSCursorUpdate)) + if ((event_type != NSMouseEntered) && (event_type != NSMouseExited)) return NULL; return event_data.tracking.user_data; @@ -450,7 +449,8 @@ - (int)data1 { // Make sure it is one of the right event types - if ((event_type != NSFlagsChanged) && (event_type != NSPeriodic)) + if ((event_type != NSFlagsChanged) && (event_type != NSCursorUpdate) && + (event_type != NSPeriodic)) return 0; return event_data.misc.data1; @@ -459,7 +459,8 @@ - (int)data2 { // Make sure it is one of the right event types - if ((event_type != NSFlagsChanged) && (event_type != NSPeriodic)) + if ((event_type != NSFlagsChanged) && (event_type != NSCursorUpdate) && + (event_type != NSPeriodic)) return 0; return event_data.misc.data2; @@ -468,7 +469,8 @@ - (short)subtype { // Make sure it is one of the right event types - if ((event_type != NSFlagsChanged) && (event_type != NSPeriodic)) + if ((event_type != NSFlagsChanged) && (event_type != NSCursorUpdate) && + (event_type != NSPeriodic)) return 0; return event_data.misc.sub_type;; @@ -479,8 +481,6 @@ // - (void)encodeWithCoder:aCoder { - [super encodeWithCoder:aCoder]; - [aCoder encodeValueOfObjCType: @encode(NSEventType) at: &event_type]; [aCoder encodePoint: location_point]; [aCoder encodeValueOfObjCType: "I" at: &modifier_flags]; @@ -506,7 +506,6 @@ case NSMouseEntered: case NSMouseExited: - case NSCursorUpdate: // Can't do anything with the user_data!? [aCoder encodeValuesOfObjCTypes: "ii", &event_data.tracking.event_num, &event_data.tracking.tracking_num]; @@ -522,6 +521,7 @@ case NSFlagsChanged: case NSPeriodic: + case NSCursorUpdate: [aCoder encodeValuesOfObjCTypes: "sii", &event_data.misc.sub_type, &event_data.misc.data1, &event_data.misc.data2]; break; @@ -530,8 +530,6 @@ - initWithCoder:aDecoder { - [super initWithCoder:aDecoder]; - [aDecoder decodeValueOfObjCType: @encode(NSEventType) at: &event_type]; location_point = [aDecoder decodePoint]; [aDecoder decodeValueOfObjCType: "I" at: &modifier_flags]; @@ -554,7 +552,6 @@ case NSMouseEntered: case NSMouseExited: - case NSCursorUpdate: // Can't do anything with the user_data!? [aDecoder decodeValuesOfObjCTypes: "ii", &event_data.tracking.event_num, &event_data.tracking.tracking_num]; @@ -571,6 +568,7 @@ case NSFlagsChanged: case NSPeriodic: + case NSCursorUpdate: [aDecoder decodeValuesOfObjCTypes: "sii", &event_data.misc.sub_type, &event_data.misc.data1, &event_data.misc.data2]; break; diff --git a/Source/NSFont.m b/Source/NSFont.m index 445547664..7a1a98f65 100644 --- a/Source/NSFont.m +++ b/Source/NSFont.m @@ -5,8 +5,9 @@ Copyright (C) 1996 Free Software Foundation, Inc. - Author: Scott Christley - Date: 1996 + Author: Ovidiu Predescu + Date: February 1997 + A completely rewritten version of the original source by Scott Christley. This file is part of the GNUstep GUI Library. @@ -26,133 +27,136 @@ 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ -#include -#include -#include +#include +#include -NSFont *gnustep_gui_user_fixed_font; -NSFont *gnustep_gui_user_font; -NSString *gnustep_gui_system_family = @""; +#include +#include // Global Strings -NSString *NSAFMAscender = @"AFMAscender"; -NSString *NSAFMCapHeight = @"AFMCapHeight"; -NSString *NSAFMCharacterSet = @"AFMCharacterSet"; -NSString *NSAFMDescender = @"AFMDescender"; -NSString *NSAFMEncodingScheme = @"AFMEncodingScheme"; -NSString *NSAFMFamilyName = @"AFMFamilyName"; -NSString *NSAFMFontName = @"AFMFontName"; -NSString *NSAFMFormatVersion = @"AFMFormatVersion"; -NSString *NSAFMFullName = @"AFMFullName"; -NSString *NSAFMItalicAngle = @"AFMItalicAngle"; -NSString *NSAFMMappingScheme = @"AFMMappingScheme"; -NSString *NSAFMNotice = @"AFMNotice"; -NSString *NSAFMUnderlinePosition = @"AFMUnderlinePosition"; -NSString *NSAFMUnderlineThickness = @"AFMUnderlineThickness"; -NSString *NSAFMVersion = @"AFMVersion"; -NSString *NSAFMWeight = @"AFMWeight"; -NSString *NSAFMXHeight = @"AFMXHeight"; +NSString*NSAFMAscender = @"Ascender"; +NSString*NSAFMCapHeight = @"CapHeight"; +NSString*NSAFMCharacterSet = @"CharacterSet"; +NSString*NSAFMDescender = @"Descender"; +NSString*NSAFMEncodingScheme = @"EncodingScheme"; +NSString*NSAFMFamilyName = @"FamilyName"; +NSString*NSAFMFontName = @"FontName"; +NSString*NSAFMFormatVersion = @"FormatVersion"; +NSString*NSAFMFullName = @"FullName"; +NSString*NSAFMItalicAngle = @"ItalicAngle"; +NSString*NSAFMMappingScheme = @"MappingScheme"; +NSString*NSAFMNotice = @"Notice"; +NSString*NSAFMUnderlinePosition = @"UnderlinePosition"; +NSString*NSAFMUnderlineThickness = @"UnderlineThickness"; +NSString*NSAFMVersion = @"Version"; +NSString*NSAFMWeight = @"Weight"; +NSString*NSAFMXHeight = @"XHeight"; @implementation NSFont +/* Class variables */ + +/* Register all the fonts used by the current print operation to be able to + dump the %%DocumentFonts comment required by the Adobe Document Structuring + Convention (see the red book). */ +static NSMutableSet* fontsUsed = nil; + +static NSFont* getFont(NSString* key, NSString* defaultFont, float fontSize) +{ + NSString* fontName; + + fontName = [[NSUserDefaults standardUserDefaults] objectForKey:key]; + if (!fontName) + fontName = defaultFont; + + return [NSFont fontWithName:fontName size:fontSize]; +} + +static void setFont(NSString* key, NSFont* font) +{ + NSUserDefaults* standardDefaults = [NSUserDefaults standardUserDefaults]; + + [standardDefaults setObject:[font fontName] forKey:key]; + + /* Don't care about errors */ + [standardDefaults synchronize]; +} + // // Class methods // + (void)initialize { - if (self == [NSFont class]) - { - NSDebugLog(@"Initialize NSFont class\n"); + static BOOL initialized = NO; - // Initial version - [self setVersion:2]; - } + if (!initialized) { + initialized = YES; + fontsUsed = [NSMutableSet new]; + } } -// -// Creating a Font Object -// -+ (NSFont *)boldSystemFontOfSize:(float)fontSize -{ - NSFontManager *fm = [NSFontManager sharedFontManager]; - NSFont *f; +/* Getting the preferred user fonts */ - f = [fm fontWithFamily:gnustep_gui_system_family traits:NSBoldFontMask - weight:0 size:fontSize]; - return f; ++ (NSFont*)boldSystemFontOfSize:(float)fontSize +{ + return getFont (@"NSBoldFont", @"Helvetica-Bold", fontSize); } -+ (NSFont *)fontWithName:(NSString *)fontName - matrix:(const float *)fontMatrix ++ (NSFont*)systemFontOfSize:(float)fontSize { + return getFont (@"NSFont", @"Helvetica", fontSize); +} + ++ (NSFont*)userFixedPitchFontOfSize:(float)fontSize +{ + return getFont (@"NSUserFixedPitchFont", @"Courier", fontSize); +} + ++ (NSFont*)userFontOfSize:(float)fontSize +{ + return getFont (@"NSUserFont", @"Helvetica", fontSize); +} + +/* Setting the preferred user fonts */ + ++ (void)setUserFixedPitchFont:(NSFont*)font +{ + setFont (@"NSUserFixedPitchFont", font); +} + ++ (void)setUserFont:(NSFont*)font +{ + setFont (@"NSUserFont", font); +} + +/* The following method should be rewritten in the backend and it has to be + called as part of the implementation. */ ++ (NSFont*)fontWithName:(NSString*)name + matrix:(const float*)fontMatrix +{ + [fontsUsed addObject:name]; return nil; } -+ (NSFont *)fontWithName:(NSString *)fontName - size:(float)fontSize ++ (NSFont*)fontWithName:(NSString*)name + size:(float)fontSize { - NSFontManager *fm = [NSFontManager sharedFontManager]; - NSFont *f; + float fontMatrix[6] = { fontSize, 0, 0, fontSize, 0, 0 }; - // +++ We need to extract the family name from the font name - f = [fm fontWithFamily:fontName traits:0 weight:400 size:fontSize]; - return f; + return [self fontWithName:name matrix:fontMatrix]; } -+ (NSFont *)systemFontOfSize:(float)fontSize ++ (void)useFont:(NSString*)name { - NSFontManager *fm = [NSFontManager sharedFontManager]; - NSFont *f; - - f = [fm fontWithFamily:gnustep_gui_system_family traits:0 - weight:400 size:fontSize]; - return f; + [fontsUsed addObject:name]; } -+ (NSFont *)userFixedPitchFontOfSize:(float)fontSize -{ - NSFontManager *fm = [NSFontManager sharedFontManager]; - return [fm convertFont:gnustep_gui_user_fixed_font toSize:fontSize]; -} - -+ (NSFont *)userFontOfSize:(float)fontSize -{ - NSFontManager *fm = [NSFontManager sharedFontManager]; - return [fm convertFont:gnustep_gui_user_font toSize:fontSize]; -} - -// -// Setting the Font -// -+ (void)setUserFixedPitchFont:(NSFont *)aFont -{ - gnustep_gui_user_fixed_font = aFont; -} - -+ (void)setUserFont:(NSFont *)aFont -{ - gnustep_gui_user_font = aFont; -} - -+ (void)useFont:(NSString *)fontName -{} - // // Instance methods // -- init -{ - [super init]; - - family_name = @""; - font_name = @""; - type_face = @""; - - return self; -} - - (void)dealloc { + [fontName release]; [super dealloc]; } @@ -166,71 +170,48 @@ NSString *NSAFMXHeight = @"AFMXHeight"; // // Querying the Font // -- (NSDictionary *)afmDictionary -{ - return nil; -} +- (float)pointSize { return matrix[3]; } +- (NSString*)fontName { return fontName; } +- (const float*)matrix { return matrix; } -- (NSString *)afmFileContents -{ - return nil; -} +/* The backends should rewrite the following methods to provide a more + appropiate behavior than these. */ -- (NSRect)boundingRectForFont -{ - return NSZeroRect; -} +- (NSString *)encodingScheme { return nil; } +- (NSString*)familyName { return nil; } +- (NSRect)boundingRectForFont { return NSZeroRect; } +- (BOOL)isFixedPitch { return NO; } +- (BOOL)isBaseFont { return YES; } -- (NSString *)displayName -{ - return nil; -} +/* Usually the display name of font is the font name. */ +- (NSString*)displayName { return fontName; } -- (NSString *)familyName -{ - return family_name; -} +- (NSDictionary*)afmDictionary { return nil; } +- (NSString*)afmFileContents { return nil; } +- (NSFont*)printerFont { return self; } +- (NSFont*)screenFont { return self; } +- (float)ascender { return 0.0; } +- (float)descender { return 0.0; } +- (float)capHeight { return 0.0; } +- (float)italicAngle { return 0.0; } +- (NSSize)maximumAdvancement { return NSZeroSize; } +- (float)underlinePosition { return 0.0; } +- (float)underlineThickness { return 0.0; } +- (float)xHeight { return 0.0; } -- (NSString *)fontName -{ - return font_name; -} - -- (BOOL)isBaseFont -{ - return NO; -} - -- (const float *)matrix -{ - return NULL; -} - -- (float)pointSize -{ - return point_size; -} - -- (NSFont *)printerFont -{ - return self; -} - -- (NSFont *)screenFont -{ - return self; -} - -- (float)widthOfString:(NSString *)string +/* Computing font metrics attributes */ +- (float)widthOfString:(NSString*)string { return 0; } -- (float *)widths +- (float*)widths { return NULL; } +/* The following methods have to implemented by backends */ + // // Manipulating Glyphs // @@ -249,6 +230,11 @@ NSString *NSAFMXHeight = @"AFMXHeight"; return NO; } +- (NSGlyph)glyphWithName:(NSString*)glyphName +{ + return -1; +} + - (NSPoint)positionOfGlyph:(NSGlyph)curGlyph precededByGlyph:(NSGlyph)prevGlyph isNominal:(BOOL *)nominal @@ -261,129 +247,16 @@ NSString *NSAFMXHeight = @"AFMXHeight"; // - (void)encodeWithCoder:aCoder { - [super encodeWithCoder:aCoder]; - - [aCoder encodeObject: family_name]; - [aCoder encodeObject: font_name]; - [aCoder encodeValueOfObjCType: "f" at: &point_size]; - [aCoder encodeValueOfObjCType: @encode(NSFontTraitMask) at: &font_traits]; - - // Version 2 - //[aCoder encodeObject: type_face]; - [aCoder encodeValueOfObjCType: @encode(int) at: &font_weight]; + [aCoder encodeObject:fontName]; + [aCoder encodeArrayOfObjCType:"f" count:6 at:matrix]; } - initWithCoder:aDecoder { - [super initWithCoder:aDecoder]; - - family_name = [aDecoder decodeObject]; - font_name = [aDecoder decodeObject]; - [aDecoder decodeValueOfObjCType: "f" at: &point_size]; - [aDecoder decodeValueOfObjCType: @encode(NSFontTraitMask) at: &font_traits]; - - // Version 2 - //type_face = [aDecoder decodeObject]; - [aDecoder decodeValueOfObjCType: @encode(int) at: &font_weight]; + fontName = [aDecoder decodeObject]; + [aDecoder decodeArrayOfObjCType:"f" count:6 at:matrix]; return self; } -@end - -@implementation NSFont (GNUstepPrivate) - -- (void)setFamilyName:(NSString *)familyName -{ - NSMutableString *s = [NSMutableString stringWithCString: ""]; - - // New family name so new font name - // Format is family name, dash, typeface - family_name = familyName; - [s appendString: family_name]; - - if ([type_face compare: @""] != NSOrderedSame) - { - [s appendString: @"-"]; - [s appendString: type_face]; - } - font_name = s; -} - -- (void)setFontName:(NSString *)fontName -{ - font_name = fontName; -} - -- (void)setPointSize:(float)value -{ - point_size = value; -} - -- (NSFontTraitMask)traits -{ - return font_traits; -} - -- (void)setTraits:(NSFontTraitMask)traits -{ - // Only if the traits have changed - if (font_traits != traits) - { - // Figure out a new typeface - NSMutableString *s = [NSMutableString stringWithCString: ""]; - - // Bold - if (traits & NSBoldFontMask) - [s appendString: @"Bold"]; - - // +++ How do we determine whether to use Italic or Oblique? - if (traits & NSItalicFontMask) - [s appendString: @"Italic"]; - - [self setTypeface: s]; - } - font_traits = traits; -} - -- (int)weight -{ - return font_weight; -} - -- (void)setWeight:(int)value -{ - NSFontTraitMask t = font_traits; - - font_weight = value; - // Make the font bold or unbold based upon the weight - if (font_weight <= 400) - t = t ^ NSUnboldFontMask; - else - t = t ^ NSBoldFontMask; - [self setTraits:t]; -} - -- (NSString *)typeface -{ - return type_face; -} - -- (void)setTypeface:(NSString *)str -{ - NSMutableString *s = [NSMutableString stringWithCString: ""]; - - // New typeface so new font name - // Format is family name, dash, typeface - type_face = str; - [s appendString: family_name]; - - if ([type_face compare: @""] != NSOrderedSame) - { - [s appendString: @"-"]; - [s appendString: type_face]; - } - font_name = s; -} - -@end +@end /* NSFont */ diff --git a/Source/NSFontManager.m b/Source/NSFontManager.m index 62dc2dd25..cbac60116 100644 --- a/Source/NSFontManager.m +++ b/Source/NSFontManager.m @@ -26,17 +26,19 @@ 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ -#include -#include -#include +#include +#include +#include +#include +#include // // Class variables // -NSFontManager *GNUSTEP_GUI_FONT_MANAGER; -NSFontPanel *GNUSTEP_GUI_FONT_PANEL; -id GNUSTEP_GUI_FONT_MANAGER_FACTORY; -id GNUSTEP_GUI_FONT_PANEL_FACTORY; +static NSFontManager *sharedFontManager = nil; +static NSFontPanel *fontPanel = nil; +static Class fontManagerClass = Nil; +static Class fontPanelClass = Nil; @implementation NSFontManager @@ -61,24 +63,24 @@ id GNUSTEP_GUI_FONT_PANEL_FACTORY; // // Managing the FontManager // -+ (void)setFontManagerFactory:(Class)classId ++ (void)setFontManagerFactory:(Class)class { - GNUSTEP_GUI_FONT_MANAGER_FACTORY = classId; + fontManagerClass = class; } -+ (void)setFontPanelFactory:(Class)classId ++ (void)setFontPanelFactory:(Class)class { - GNUSTEP_GUI_FONT_PANEL_FACTORY = classId; + fontPanelClass = class; } + (NSFontManager *)sharedFontManager { - if (!GNUSTEP_GUI_FONT_MANAGER) + if (!sharedFontManager) { - GNUSTEP_GUI_FONT_MANAGER = [[NSFontManager alloc] init]; - [GNUSTEP_GUI_FONT_MANAGER enumerateFontsAndFamilies]; + sharedFontManager = [[fontManagerClass alloc] init]; + [sharedFontManager enumerateFontsAndFamilies]; } - return GNUSTEP_GUI_FONT_MANAGER; + return sharedFontManager; } // @@ -86,18 +88,17 @@ id GNUSTEP_GUI_FONT_PANEL_FACTORY; // - init { - [super init]; + self = [super init]; // Allocate the font list - font_list = [NSMutableArray array]; - - // Allocate the family list - family_list = [NSMutableArray array]; - family_metrics = [NSMutableArray array]; + fontsList = [NSMutableArray array]; return self; } +#if 0 +/* This code needs to be reworked */ + // // Converting Fonts // @@ -225,10 +226,10 @@ id GNUSTEP_GUI_FONT_PANEL_FACTORY; NSFont *f; // Make sure it is a legitimate family name - j = [family_list count]; + j = [fontsList count]; for (i = 0;i < j; ++i) { - name = [family_list objectAtIndex:i]; + name = [fontsList objectAtIndex:i]; if ([family compare:name] == NSOrderedSame) { found = YES; @@ -252,6 +253,7 @@ id GNUSTEP_GUI_FONT_PANEL_FACTORY; return nil; } } +#endif // // Setting and Getting Parameters @@ -263,12 +265,7 @@ id GNUSTEP_GUI_FONT_PANEL_FACTORY; - (NSArray *)availableFonts { - return family_list; -} - -- (NSArray *)familyMetrics; -{ - return family_metrics; + return fontsList; } - (NSMenu *)fontMenu:(BOOL)create @@ -278,9 +275,9 @@ id GNUSTEP_GUI_FONT_PANEL_FACTORY; - (NSFontPanel *)fontPanel:(BOOL)create { - if ((!GNUSTEP_GUI_FONT_PANEL) && (create)) - GNUSTEP_GUI_FONT_PANEL = [[NSFontPanel alloc] init]; - return GNUSTEP_GUI_FONT_PANEL; + if ((!fontPanel) && (create)) + fontPanel = [[fontPanelClass alloc] init]; + return fontPanel; } - (BOOL)isEnabled @@ -315,6 +312,7 @@ id GNUSTEP_GUI_FONT_PANEL_FACTORY; selected_font = fontObject; } +#if 0 - (NSFontTraitMask)traitsOfFont:(NSFont *)fontObject { return [fontObject traits]; @@ -324,6 +322,7 @@ id GNUSTEP_GUI_FONT_PANEL_FACTORY; { return [fontObject weight]; } +#endif // // Target and Action Methods diff --git a/Source/NSFontPanel.m b/Source/NSFontPanel.m index 148c4df6a..330087dd0 100644 --- a/Source/NSFontPanel.m +++ b/Source/NSFontPanel.m @@ -26,9 +26,9 @@ 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ -#include -#include -#include +#include +#include +#include @implementation NSFontPanel diff --git a/Source/NSForm.m b/Source/NSForm.m index 414f21bc9..d310c6f11 100644 --- a/Source/NSForm.m +++ b/Source/NSForm.m @@ -26,7 +26,7 @@ 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ -#include +#include @implementation NSForm diff --git a/Source/NSFormCell.m b/Source/NSFormCell.m index 52d8df072..17dd8e3f3 100644 --- a/Source/NSFormCell.m +++ b/Source/NSFormCell.m @@ -26,7 +26,7 @@ 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ -#include +#include @implementation NSFormCell diff --git a/Source/NSHelpPanel.m b/Source/NSHelpPanel.m index 6552bbdd5..63fcf9b95 100644 --- a/Source/NSHelpPanel.m +++ b/Source/NSHelpPanel.m @@ -26,7 +26,7 @@ 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ -#include +#include @implementation NSHelpPanel diff --git a/Source/NSImage.m b/Source/NSImage.m index dbede81ec..c9d312d5d 100644 --- a/Source/NSImage.m +++ b/Source/NSImage.m @@ -30,22 +30,23 @@ (findImageNamed:). [3] bestRepresentation is not complete. */ +#include + +#include +#include +#include +#include +#include #include #include #include #include #include #include -#include -#include -#include -#include -#include -#include +#include -#ifndef NSImage_PATH -#define NSImage_PATH OBJC_STRINGIFY(GNUSTEP_INSTALL_LIBDIR) @"/Images" -#endif +static NSString* NSImage_PATH + = @GNUSTEP_INSTALL_LIBDIR @"/Images"; /* Backend protocol - methods that must be implemented by the backend to complete the class */ @@ -187,11 +188,12 @@ set_repd_for_rep(NSMutableArray *_reps, NSImageRep *rep, rep_data_t *new_repd) /* If not found then search in system */ if (!path) { + NSArray* dirsArray = [NSArray arrayWithObject:NSImage_PATH]; + if (ext) path = [NSBundle pathForResource: aName ofType: ext - inDirectory: NSImage_PATH - withVersion: 0]; + inDirectories:dirsArray]; else { id o, e; @@ -203,11 +205,10 @@ set_repd_for_rep(NSMutableArray *_reps, NSImageRep *rep, rep_data_t *new_repd) e = [array objectEnumerator]; while ((o = [e nextObject])) { - NSLog(@"extension %s\n", [o cString]); + NSLog(@"extension %s, array = %@\n", [o cString], dirsArray); path = [NSBundle pathForResource: aName ofType: o - inDirectory: NSImage_PATH - withVersion: 0]; + inDirectories:dirsArray]; if ([path length] != 0) break; } @@ -322,7 +323,7 @@ set_repd_for_rep(NSMutableArray *_reps, NSImageRep *rep, rep_data_t *new_repd) NSImage* copy; // FIXME: maybe we should retain if _flags.dataRetained = NO - copy = [super copyWithZone: zone]; + copy = (NSImage*)NSAllocateObject (isa, 0, zone); [name retain]; [_color retain]; @@ -339,6 +340,11 @@ set_repd_for_rep(NSMutableArray *_reps, NSImageRep *rep, rep_data_t *new_repd) if (!string || [nameDict objectForKey: string]) return NO; + + [string retain]; + [name release]; + name = string; + [nameDict setObject: self forKey: name]; return YES; } @@ -413,7 +419,7 @@ set_repd_for_rep(NSMutableArray *_reps, NSImageRep *rep, rep_data_t *new_repd) // Determining How the Image is Drawn - (BOOL) isValid { - BOOL valid; + BOOL valid = NO; int i, count; /* Go through all our representations and determine if at least one @@ -611,7 +617,7 @@ set_repd_for_rep(NSMutableArray *_reps, NSImageRep *rep, rep_data_t *new_repd) ok = NO; rep = [NSImageRep imageRepClassForData: data]; - if (rep && [rep respondsTo: @selector(imageRepsWithData:)]) + if (rep && [rep respondsToSelector: @selector(imageRepsWithData:)]) { NSArray* array; array = [rep imageRepsWithData: data]; @@ -733,8 +739,11 @@ set_repd_for_rep(NSMutableArray *_reps, NSImageRep *rep, rep_data_t *new_repd) - (void) lockFocusOnRepresentation: (NSImageRep *)imageRep { +#if 0 NSScreen *cur = [NSScreen mainScreen]; NSWindow *window; +#endif + if (!imageRep) [NSException raise: NSInvalidArgumentException format: @"Cannot lock focus on nil rep"]; @@ -873,12 +882,10 @@ set_repd_for_rep(NSMutableArray *_reps, NSImageRep *rep, rep_data_t *new_repd) // NSCoding - (void)encodeWithCoder:(NSCoder *)coder { - [super encodeWithCoder:coder]; } - (id)initWithCoder:(NSCoder *)coder { - self = [super initWithCoder:coder]; return self; } @@ -941,7 +948,7 @@ iterate_reps_for_types(NSArray* imageReps, SEL method) { NSImageRep *rep; id e; - int i, count; +// int i, count; NSMutableArray* types; types = [NSMutableArray arrayWithCapacity: 2]; diff --git a/Source/NSImageRep.m b/Source/NSImageRep.m index 17c2b8e21..c32845d29 100644 --- a/Source/NSImageRep.m +++ b/Source/NSImageRep.m @@ -33,9 +33,10 @@ #include #include #include +#include // NSImageRep notifications -NSString *NSImageRepRegistryChangedNotification; +NSString *NSImageRepRegistryChangedNotification = @"NSImageRepRegistryChangedNotification"; /* Backend protocol - methods that must be implemented by the backend to complete the class */ @@ -373,8 +374,6 @@ extension(NSString *name) // NSCoding protocol - (void) encodeWithCoder: aCoder { - [super encodeWithCoder: aCoder]; - [aCoder encodeObject: _colorSpace]; [aCoder encodeSize: size]; [aCoder encodeValueOfObjCType: @encode(BOOL) at: &hasAlpha]; @@ -386,8 +385,6 @@ extension(NSString *name) - initWithCoder: aDecoder { - self = [super initWithCoder: aDecoder]; - _colorSpace = [[aDecoder decodeObject] retain]; size = [aDecoder decodeSize]; [aDecoder decodeValueOfObjCType: @encode(BOOL) at: &hasAlpha]; diff --git a/Source/NSMatrix.m b/Source/NSMatrix.m index a9fffa56d..fcff9ac82 100644 --- a/Source/NSMatrix.m +++ b/Source/NSMatrix.m @@ -27,19 +27,19 @@ 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ -#include #include #include -#include -#include -#include +#include +#include +#include +#include #define GNU_DEFAULT_CELL_HEIGHT 20 // // Class variables // -Class NSMATRIX_DEFAULT_CELL_CLASS; +static Class NSMATRIX_DEFAULT_CELL_CLASS = nil; @implementation NSMatrix @@ -656,8 +656,7 @@ Class NSMATRIX_DEFAULT_CELL_CLASS; - (void)insertRow:(int)row withCells:(NSArray *)cellArray { - NSCell *newCell; - int i, count; + int i; id e, o; // No array then forget the insert @@ -996,7 +995,10 @@ Class NSMATRIX_DEFAULT_CELL_CLASS; - (id)selectedCell { - return [selected_cells lastObject]; + if ([selected_cells count]) + return [selected_cells lastObject]; + + return nil; } /* @@ -1074,7 +1076,6 @@ Class NSMATRIX_DEFAULT_CELL_CLASS; - (id)cellWithTag:(int)anInt { id re, ce; - int i, j; NSMutableArray *aRow; NSCell *aCell; @@ -1356,7 +1357,6 @@ Class NSMATRIX_DEFAULT_CELL_CLASS; { NSCell *aCell = [self cellAtRow:row column:column]; NSRect cellFrame; - BOOL did_lock = NO; if (aCell != nil) { diff --git a/Source/NSMenu.m b/Source/NSMenu.m index 84dd94fc2..c9ae357a7 100644 --- a/Source/NSMenu.m +++ b/Source/NSMenu.m @@ -26,11 +26,14 @@ 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ -#include -#include #include -#include -#include +#include +#include +#include +#include +#include +#include +#include NSZone *gnustep_gui_nsmenu_zone = NULL; @@ -75,7 +78,7 @@ NSZone *gnustep_gui_nsmenu_zone = NULL; // Default initializer - (id)initWithTitle:(NSString *)aTitle { - NSApplication *theApp = [NSApplication sharedApplication]; + // NSApplication *theApp = [NSApplication sharedApplication]; // Init our superclass but skip any of its backend implementation [super init]; @@ -106,7 +109,6 @@ NSZone *gnustep_gui_nsmenu_zone = NULL; keyEquivalent:(NSString *)charCode { NSMenuCell *m; - unsigned int mi; m = [[NSMenuCell alloc] initTextCell:aString]; [m setAction:aSelector]; @@ -121,7 +123,6 @@ NSZone *gnustep_gui_nsmenu_zone = NULL; atIndex:(unsigned int)index { NSMenuCell *m; - unsigned int mi; m = [[NSMenuCell alloc] initTextCell:aString]; [m setAction:aSelector]; @@ -247,13 +248,15 @@ NSZone *gnustep_gui_nsmenu_zone = NULL; // - (void)encodeWithCoder:aCoder { - [super encodeWithCoder:aCoder]; - [aCoder encodeObject: menu_items]; // Version 2 [aCoder encodeObject: window_title]; +#if 0 [aCoder encodeObjectReference: super_menu withName: @"SuperMenu"]; +#else + [aCoder encodeConditionalObject:super_menu]; +#endif [aCoder encodeValueOfObjCType:@encode(BOOL) at: &autoenables_items]; [aCoder encodeObject: menu_matrix]; [aCoder encodeValueOfObjCType:@encode(BOOL) at: &is_torn_off]; @@ -261,13 +264,15 @@ NSZone *gnustep_gui_nsmenu_zone = NULL; - initWithCoder:aDecoder { - [super initWithCoder:aDecoder]; - menu_items = [aDecoder decodeObject]; // Version 2 window_title = [aDecoder decodeObject]; +#if 0 [aDecoder decodeObjectAt: &super_menu withName: NULL]; +#else + super_menu = [aDecoder decodeObject]; +#endif [aDecoder decodeValueOfObjCType:@encode(BOOL) at: &autoenables_items]; menu_matrix = [aDecoder decodeObject]; [aDecoder decodeValueOfObjCType:@encode(BOOL) at: &is_torn_off]; diff --git a/Source/NSMenuCell.m b/Source/NSMenuCell.m index 3e713b918..6f9efd453 100644 --- a/Source/NSMenuCell.m +++ b/Source/NSMenuCell.m @@ -26,14 +26,14 @@ 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ -#include -#include -#include +#include +#include +#include // // Class variables // -BOOL MB_NSMENUCELL_USES_KEY; +static BOOL MB_NSMENUCELL_USES_KEY = NO; @implementation NSMenuCell diff --git a/Source/NSOpenPanel.m b/Source/NSOpenPanel.m index ec697bdb0..8ce199977 100644 --- a/Source/NSOpenPanel.m +++ b/Source/NSOpenPanel.m @@ -26,9 +26,11 @@ 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ -#include +#include +#include +#include -NSOpenPanel *MB_THE_OPEN_PANEL; +static NSOpenPanel *MB_THE_OPEN_PANEL = nil; @implementation NSOpenPanel @@ -130,6 +132,7 @@ NSOpenPanel *MB_THE_OPEN_PANEL; // - (int)runModalForTypes:(NSArray *)fileTypes { + return 0; } - (int)runModalForDirectory:(NSString *)path diff --git a/Source/NSPageLayout.m b/Source/NSPageLayout.m index 984949d14..4423e8704 100644 --- a/Source/NSPageLayout.m +++ b/Source/NSPageLayout.m @@ -26,7 +26,7 @@ 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ -#include +#include @implementation NSPageLayout diff --git a/Source/NSPanel.m b/Source/NSPanel.m index 33d0df8c7..9bb5ade96 100644 --- a/Source/NSPanel.m +++ b/Source/NSPanel.m @@ -26,7 +26,7 @@ 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ -#include +#include @implementation NSPanel diff --git a/Source/NSPasteboard.m b/Source/NSPasteboard.m index c6660616a..6d9d8004f 100644 --- a/Source/NSPasteboard.m +++ b/Source/NSPasteboard.m @@ -26,28 +26,28 @@ 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ -#include +#include // Pasteboard Type Globals -NSString *NSStringPboardType; -NSString *NSColorPboardType; -NSString *NSFileContentsPboardType; -NSString *NSFilenamesPboardType; -NSString *NSFontPboardType; -NSString *NSRulerPboardType; -NSString *NSPostScriptPboardType; -NSString *NSTabularTextPboardType; -NSString *NSRTFPboardType; -NSString *NSTIFFPboardType; -NSString *NSDataLinkPboardType; -NSString *NSGeneralPboardType; +NSString *NSStringPboardType = @"NSStringPboardType"; +NSString *NSColorPboardType = @"NSColorPboardType"; +NSString *NSFileContentsPboardType = @"NSFileContentsPboardType"; +NSString *NSFilenamesPboardType = @"NSFilenamesPboardType"; +NSString *NSFontPboardType = @"NSFontPboardType"; +NSString *NSRulerPboardType = @"NSRulerPboardType"; +NSString *NSPostScriptPboardType = @"NSPostScriptPboardType"; +NSString *NSTabularTextPboardType = @"NSTabularTextPboardType"; +NSString *NSRTFPboardType = @"NSRTFPboardType"; +NSString *NSTIFFPboardType = @"NSTIFFPboardType"; +NSString *NSDataLinkPboardType = @"NSDataLinkPboardType"; +NSString *NSGeneralPboardType = @"NSGeneralPboardType"; // Pasteboard Name Globals -NSString *NSDragPboard; -NSString *NSFindPboard; -NSString *NSFontPboard; -NSString *NSGeneralPboard; -NSString *NSRulerPboard; +NSString *NSDragPboard = @"NSDragPboard"; +NSString *NSFindPboard = @"NSFindPboard"; +NSString *NSFontPboard = @"NSFontPboard"; +NSString *NSGeneralPboard = @"NSGeneralPboard"; +NSString *NSRulerPboard = @"NSRulerPboard"; @implementation NSPasteboard diff --git a/Source/NSPopUpButton.m b/Source/NSPopUpButton.m index 10df37d1b..bcd45c1ff 100644 --- a/Source/NSPopUpButton.m +++ b/Source/NSPopUpButton.m @@ -26,8 +26,9 @@ 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ -#include -#include +#include +#include +#include // // NSPopUpButton implementation @@ -110,8 +111,6 @@ // - (void)addItemWithTitle:(NSString *)title { - char out[80]; - [list_items addObject:title]; [self synchronizeTitleAndSelectedItem]; } @@ -214,8 +213,6 @@ - (void)selectItemAtIndex:(int)index { - char out[80]; - if ((index >= 0) && (index <= [list_items count])) { selected_item = index; @@ -274,10 +271,6 @@ - (NSView *)hitTest:(NSPoint)aPoint { - NSPoint p; - char out[80]; - NSRect wr; - // First check ourselves if ([self mouse:aPoint inRect:bounds]) return self; @@ -301,7 +294,11 @@ [aCoder encodeObject: list_items]; [aCoder encodeRect: list_rect]; [aCoder encodeValueOfObjCType: "i" at: &selected_item]; +#if 0 [aCoder encodeObjectReference: pub_target withName: @"Target"]; +#else + [aCoder encodeConditionalObject:pub_target]; +#endif [aCoder encodeValueOfObjCType: @encode(SEL) at: &pub_action]; [aCoder encodeValueOfObjCType: @encode(BOOL) at: &is_up]; [aCoder encodeValueOfObjCType: @encode(BOOL) at: &pulls_down]; @@ -314,7 +311,11 @@ list_items = [aDecoder decodeObject]; list_rect = [aDecoder decodeRect]; [aDecoder decodeValueOfObjCType: "i" at: &selected_item]; +#if 0 [aDecoder decodeObjectAt: &pub_target withName: NULL]; +#else + pub_target = [aDecoder decodeObject]; +#endif [aDecoder decodeValueOfObjCType: @encode(SEL) at: &pub_action]; [aDecoder decodeValueOfObjCType: @encode(BOOL) at: &is_up]; [aDecoder decodeValueOfObjCType: @encode(BOOL) at: &pulls_down]; diff --git a/Source/NSPrintInfo.m b/Source/NSPrintInfo.m index 716262a14..c026680b4 100644 --- a/Source/NSPrintInfo.m +++ b/Source/NSPrintInfo.m @@ -26,7 +26,7 @@ 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ -#include +#include @implementation NSPrintInfo @@ -218,13 +218,10 @@ // - (void)encodeWithCoder:aCoder { - [super encodeWithCoder:aCoder]; } - initWithCoder:aDecoder { - [super initWithCoder:aDecoder]; - return self; } diff --git a/Source/NSPrintOperation.m b/Source/NSPrintOperation.m index 5e5f77dd8..248ea2f74 100644 --- a/Source/NSPrintOperation.m +++ b/Source/NSPrintOperation.m @@ -26,7 +26,7 @@ 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ -#include +#include @implementation NSPrintOperation diff --git a/Source/NSPrintPanel.m b/Source/NSPrintPanel.m index 66112276c..eda857a2b 100644 --- a/Source/NSPrintPanel.m +++ b/Source/NSPrintPanel.m @@ -26,7 +26,7 @@ 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ -#include +#include @implementation NSPrintPanel diff --git a/Source/NSPrinter.m b/Source/NSPrinter.m index 6bebe1d2d..9bf2f81ee 100644 --- a/Source/NSPrinter.m +++ b/Source/NSPrinter.m @@ -26,50 +26,49 @@ 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ -#include +#include // Printing Information Dictionary Keys -NSString *NSPrintAllPages; -NSString *NSPrintBottomMargin; -NSString *NSPrintCopies; -NSString *NSPrintFaxCoverSheetName; -NSString *NSPrintFaxHighResolution; -NSString *NSPrintFaxModem; -NSString *NSPrintFaxReceiverNames; -NSString *NSPrintFaxReceiverNumbers; -NSString *NSPrintFaxReturnReceipt; -NSString *NSPrintFaxSendTime; -NSString *NSPrintFaxTrimPageEnds; -NSString *NSPrintFaxUseCoverSheet; -NSString *NSPrintFirstPage; -NSString *NSPrintHorizonalPagination; -NSString *NSPrintHorizontallyCentered; -NSString *NSPrintJobDisposition; -NSString *NSPrintJobFeatures; -NSString *NSPrintLastPage; -NSString *NSPrintLeftMargin; -NSString *NSPrintManualFeed; -NSString *NSPrintOrientation; -NSString *NSPrintPackageException; -NSString *NSPrintPagesPerSheet; -NSString *NSPrintPaperFeed; -NSString *NSPrintPaperName; -NSString *NSPrintPaperSize; -NSString *NSPrintPrinter; -NSString *NSPrintReversePageOrder; -NSString *NSPrintRightMargin; -NSString *NSPrintSavePath; -NSString *NSPrintScalingFactor; -NSString *NSPrintTopMargin; -NSString *NSPrintVerticalPagination; -NSString *NSPrintVerticallyCentered; +NSString *NSPrintAllPages = @"NSPrintAllPages"; +NSString *NSPrintBottomMargin = @"NSPrintBottomMargin"; +NSString *NSPrintCopies = @"NSPrintCopies"; +NSString *NSPrintFaxCoverSheetName = @"NSPrintFaxCoverSheetName"; +NSString *NSPrintFaxHighResolution = @"NSPrintFaxHighResolution"; +NSString *NSPrintFaxModem = @"NSPrintFaxModem"; +NSString *NSPrintFaxReceiverNames = @"NSPrintFaxReceiverNames"; +NSString *NSPrintFaxReceiverNumbers = @"NSPrintFaxReceiverNumbers"; +NSString *NSPrintFaxReturnReceipt = @"NSPrintFaxReturnReceipt"; +NSString *NSPrintFaxSendTime = @"NSPrintFaxSendTime"; +NSString *NSPrintFaxTrimPageEnds = @"NSPrintFaxTrimPageEnds"; +NSString *NSPrintFaxUseCoverSheet = @"NSPrintFaxUseCoverSheet"; +NSString *NSPrintFirstPage = @"NSPrintFirstPage"; +NSString *NSPrintHorizonalPagination = @"NSPrintHorizonalPagination"; +NSString *NSPrintHorizontallyCentered = @"NSPrintHorizontallyCentered"; +NSString *NSPrintJobDisposition = @"NSPrintJobDisposition"; +NSString *NSPrintJobFeatures = @"NSPrintJobFeatures"; +NSString *NSPrintLastPage = @"NSPrintLastPage"; +NSString *NSPrintLeftMargin = @"NSPrintLeftMargin"; +NSString *NSPrintManualFeed = @"NSPrintManualFeed"; +NSString *NSPrintOrientation = @"NSPrintOrientation"; +NSString *NSPrintPagesPerSheet = @"NSPrintPagesPerSheet"; +NSString *NSPrintPaperFeed = @"NSPrintPaperFeed"; +NSString *NSPrintPaperName = @"NSPrintPaperName"; +NSString *NSPrintPaperSize = @"NSPrintPaperSize"; +NSString *NSPrintPrinter = @"NSPrintPrinter"; +NSString *NSPrintReversePageOrder = @"NSPrintReversePageOrder"; +NSString *NSPrintRightMargin = @"NSPrintRightMargin"; +NSString *NSPrintSavePath = @"NSPrintSavePath"; +NSString *NSPrintScalingFactor = @"NSPrintScalingFactor"; +NSString *NSPrintTopMargin = @"NSPrintTopMargin"; +NSString *NSPrintVerticalPagination = @"NSPrintVerticalPagination"; +NSString *NSPrintVerticallyCentered = @"NSPrintVerticallyCentered"; // Print Job Disposition Values -NSString *NSPrintCancelJob; -NSString *NSPrintFaxJob; -NSString *NSPrintPreviewJob; -NSString *NSPrintSaveJob; -NSString *NSPrintSpoolJob; +NSString *NSPrintCancelJob = @"NSPrintCancelJob"; +NSString *NSPrintFaxJob = @"NSPrintFaxJob"; +NSString *NSPrintPreviewJob = @"NSPrintPreviewJob"; +NSString *NSPrintSaveJob = @"NSPrintSaveJob"; +NSString *NSPrintSpoolJob = @"NSPrintSpoolJob"; @implementation NSPrinter @@ -233,13 +232,10 @@ NSString *NSPrintSpoolJob; // - (void)encodeWithCoder:aCoder { - [super encodeWithCoder:aCoder]; } - initWithCoder:aDecoder { - [super initWithCoder:aDecoder]; - return self; } diff --git a/Source/NSResponder.m b/Source/NSResponder.m index 9f99ca5aa..c908f555d 100644 --- a/Source/NSResponder.m +++ b/Source/NSResponder.m @@ -26,8 +26,10 @@ 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ -#include -#include +#include +#include +#include +#include @implementation NSResponder @@ -239,16 +241,20 @@ // - (void)encodeWithCoder:aCoder { - [super encodeWithCoder:aCoder]; - +#if 0 [aCoder encodeObjectReference: next_responder withName: @"Next responder"]; +#else + [aCoder encodeConditionalObject:next_responder]; +#endif } - initWithCoder:aDecoder { - [super initWithCoder:aDecoder]; - +#if 0 [aDecoder decodeObjectAt: &next_responder withName: NULL]; +#else + next_responder = [aDecoder decodeObject]; +#endif return self; } diff --git a/Source/NSSavePanel.m b/Source/NSSavePanel.m index 5119bff75..c69339231 100644 --- a/Source/NSSavePanel.m +++ b/Source/NSSavePanel.m @@ -26,13 +26,15 @@ 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ -#include -#include +#include + +#include +#include // // Class variables // -NSSavePanel *MB_THE_SAVE_PANEL; +static NSSavePanel *MB_THE_SAVE_PANEL = nil; @implementation NSSavePanel @@ -161,6 +163,7 @@ NSSavePanel *MB_THE_SAVE_PANEL; - (int)runModal { + return 0; } // @@ -223,6 +226,7 @@ with:(NSString *)filename2 @selector(panel:compareFilename:with:caseSensitive:)]) return [delegate panel:sender compareFilename:filename1 with:filename2 caseSensitive:caseSensitive]; + return NSOrderedSame; } - (BOOL)panel:(id)sender @@ -230,6 +234,7 @@ shouldShowFilename:(NSString *)filename { if ([delegate respondsToSelector:@selector(panel:shouldShowFilename:)]) return [delegate panel:sender shouldShowFilename:filename]; + return NO; } - (BOOL)panel:(id)sender @@ -237,6 +242,7 @@ isValidFilename:(NSString*)filename { if ([delegate respondsToSelector:@selector(panel:isValidFilename:)]) return [delegate panel:sender isValidFilename:filename]; + return NO; } // @@ -244,8 +250,6 @@ isValidFilename:(NSString*)filename // - (void)encodeWithCoder:aCoder { - [super encodeWithCoder:aCoder]; - [aCoder encodeObject: accessory_view]; [aCoder encodeObject: panel_title]; [aCoder encodeObject: panel_prompt]; @@ -253,13 +257,15 @@ isValidFilename:(NSString*)filename [aCoder encodeObject: file_name]; [aCoder encodeObject: required_type]; [aCoder encodeValueOfObjCType: @encode(BOOL) at:&required_type]; +#if 0 [aCoder encodeObjectReference: delegate withName: @"Delegate"]; +#else + [aCoder encodeConditionalObject:delegate]; +#endif } - initWithCoder:aDecoder { - [super initWithCoder:aDecoder]; - accessory_view = [aDecoder decodeObject]; panel_title = [aDecoder decodeObject]; panel_prompt = [aDecoder decodeObject]; @@ -267,7 +273,11 @@ isValidFilename:(NSString*)filename file_name = [aDecoder decodeObject]; required_type = [aDecoder decodeObject]; [aDecoder decodeValueOfObjCType: @encode(BOOL) at:&required_type]; +#if 0 [aDecoder decodeObjectAt: &delegate withName: NULL]; +#else + delegate = [aDecoder decodeObject]; +#endif return self; } diff --git a/Source/NSScreen.m b/Source/NSScreen.m index a232fcb92..8cef6e579 100644 --- a/Source/NSScreen.m +++ b/Source/NSScreen.m @@ -26,7 +26,8 @@ 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ -#include +#include +#include // Global device dictionary key strings NSString *NSDeviceResolution = @"Resolution"; diff --git a/Source/NSScrollView.m b/Source/NSScrollView.m index c4886127b..32a89aca8 100644 --- a/Source/NSScrollView.m +++ b/Source/NSScrollView.m @@ -26,7 +26,7 @@ 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ -#include +#include @implementation NSScrollView diff --git a/Source/NSScroller.m b/Source/NSScroller.m index cee03c566..967eaa3ce 100644 --- a/Source/NSScroller.m +++ b/Source/NSScroller.m @@ -26,9 +26,9 @@ 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ -#include -#include -#include +#include +#include +#include @implementation NSScroller @@ -155,7 +155,11 @@ [aCoder encodeValueOfObjCType: @encode(BOOL) at: &is_horizontal]; [aCoder encodeValueOfObjCType: @encode(SEL) at: &action]; +#if 0 [aCoder encodeObjectReference: target withName: @"Target"]; +#else + [aCoder encodeConditionalObject:target]; +#endif [aCoder encodeValuesOfObjCTypes: "ff", &percent, &cur_value]; } @@ -165,7 +169,11 @@ [aDecoder decodeValueOfObjCType: @encode(BOOL) at: &is_horizontal]; [aDecoder decodeValueOfObjCType: @encode(SEL) at: &action]; +#if 0 [aDecoder decodeObjectAt: &target withName: NULL]; +#else + target = [aDecoder decodeObject]; +#endif [aDecoder decodeValuesOfObjCTypes: "ff", &percent, &cur_value]; return self; diff --git a/Source/NSSelection.m b/Source/NSSelection.m index adec6c93d..7fec8f16f 100644 --- a/Source/NSSelection.m +++ b/Source/NSSelection.m @@ -26,7 +26,7 @@ 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ -#include +#include @implementation NSSelection @@ -109,13 +109,10 @@ // - (void)encodeWithCoder:aCoder { - [super encodeWithCoder:aCoder]; } - initWithCoder:aDecoder { - [super initWithCoder:aDecoder]; - return self; } diff --git a/Source/NSSlider.m b/Source/NSSlider.m index c94365c76..e45a58fc4 100644 --- a/Source/NSSlider.m +++ b/Source/NSSlider.m @@ -26,13 +26,13 @@ 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ -#include -#include +#include +#include // // class variables // -id MB_NSSLIDER_CLASS; +static id MB_NSSLIDER_CLASS = nil; // // NSSlider implementation diff --git a/Source/NSSliderCell.m b/Source/NSSliderCell.m index 5c6b4eacf..4f34eb98e 100644 --- a/Source/NSSliderCell.m +++ b/Source/NSSliderCell.m @@ -26,11 +26,11 @@ 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ -#include -#include -#include -#include -#include +#include +#include +#include +#include +#include // // NSSliderCell implementation @@ -135,7 +135,7 @@ - (void)setMaxValue:(double)aDouble { - double val_range,value; + double val_range; // Swap values if new max is less than min if (aDouble < min_value) @@ -157,7 +157,7 @@ - (void)setMinValue:(double)aDouble { - double val_range,value; + double val_range; // Swap values if new min is greater than max if (aDouble > max_value) diff --git a/Source/NSSpellChecker.m b/Source/NSSpellChecker.m index 7c31758d8..4a4f502cf 100644 --- a/Source/NSSpellChecker.m +++ b/Source/NSSpellChecker.m @@ -26,7 +26,7 @@ 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ -#include +#include @implementation NSSpellChecker diff --git a/Source/NSSpellServer.m b/Source/NSSpellServer.m index c141bd480..4c2f3ab6f 100644 --- a/Source/NSSpellServer.m +++ b/Source/NSSpellServer.m @@ -26,7 +26,7 @@ 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ -#include +#include @implementation NSSpellServer diff --git a/Source/NSSplitView.m b/Source/NSSplitView.m index 8187f9466..280ff7360 100644 --- a/Source/NSSplitView.m +++ b/Source/NSSplitView.m @@ -26,11 +26,11 @@ 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ -#include +#include // NSSplitView notifications -NSString *NSSplitViewDidResizeSubviewsNotification; -NSString *NSSplitViewWillResizeSubviewsNotification; +NSString *NSSplitViewDidResizeSubviewsNotification = @"NSSplitViewDidResizeSubviewsNotification"; +NSString *NSSplitViewWillResizeSubviewsNotification = @"NSSplitViewWillResizeSubviewsNotification"; @implementation NSSplitView diff --git a/Source/NSText.m b/Source/NSText.m index f2f5f63bc..913306e90 100644 --- a/Source/NSText.m +++ b/Source/NSText.m @@ -26,15 +26,17 @@ 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ -#include -#include -#include -#include +#include +#include +#include +#include +#include +#include // NSText notifications -NSString *NSTextDidBeginEditingNotification; -NSString *NSTextDidEndEditingNotification; -NSString *NSTextDidChangeNotification; +NSString *NSTextDidBeginEditingNotification = @"NSTextDidBeginEditingNotification"; +NSString *NSTextDidEndEditingNotification = @"NSTextDidEndEditingNotification"; +NSString *NSTextDidChangeNotification = @"NSTextDidChangeNotification"; // // NSText implementation @@ -530,7 +532,11 @@ NSString *NSTextDidChangeNotification; { [super encodeWithCoder:aCoder]; +#if 0 [aCoder encodeObjectReference: delegate withName: @"Delegate"]; +#else + [aCoder encodeConditionalObject:delegate]; +#endif [aCoder encodeObject: text_contents]; [aCoder encodeValueOfObjCType: "I" at: &alignment]; [aCoder encodeValueOfObjCType: @encode(BOOL) at: &is_editable]; @@ -552,7 +558,11 @@ NSString *NSTextDidChangeNotification; { [super initWithCoder:aDecoder]; +#if 0 [aDecoder decodeObjectAt: &delegate withName: NULL]; +#else + delegate = [aDecoder decodeObject]; +#endif text_contents = [aDecoder decodeObject]; [aDecoder decodeValueOfObjCType: "I" at: &alignment]; [aDecoder decodeValueOfObjCType: @encode(BOOL) at: &is_editable]; diff --git a/Source/NSTextField.m b/Source/NSTextField.m index 39ee715c1..ab61675f0 100644 --- a/Source/NSTextField.m +++ b/Source/NSTextField.m @@ -26,15 +26,15 @@ 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ -#include -#include -#include -#include +#include +#include +#include +#include // // class variables // -id MB_NSTEXTFIELDCELL_CLASS; +static id MB_NSTEXTFIELDCELL_CLASS = nil; @implementation NSTextField @@ -82,7 +82,6 @@ id MB_NSTEXTFIELDCELL_CLASS; [[self cell] release]; [self setCell:[[MB_NSTEXTFIELDCELL_CLASS alloc] init]]; [cell setState:1]; - text_cursor = [NSCursor IBeamCursor]; return self; } @@ -276,10 +275,8 @@ id MB_NSTEXTFIELDCELL_CLASS; - (void)keyDown:(NSEvent *)theEvent { - int result; unsigned int flags = [theEvent modifierFlags]; unsigned int key_code = [theEvent keyCode]; - char out[80]; // If SHIFT-TAB key then make the previous text the first responder if ((key_code == 0x09) && (flags & NSShiftKeyMask)) @@ -370,19 +367,19 @@ id MB_NSTEXTFIELDCELL_CLASS; - (void)textDidBeginEditing:(NSNotification *)aNotification { - if ([text_delegate respondsTo:@selector(textDidBeginEditing:)]) + if ([text_delegate respondsToSelector:@selector(textDidBeginEditing:)]) return [text_delegate textDidBeginEditing:aNotification]; } - (void)textDidChange:(NSNotification *)aNotification { - if ([text_delegate respondsTo:@selector(textDidChange:)]) + if ([text_delegate respondsToSelector:@selector(textDidChange:)]) return [text_delegate textDidChange:aNotification]; } - (void)textDidEndEditing:(NSNotification *)aNotification { - if ([text_delegate respondsTo:@selector(textDidEndEditing:)]) + if ([text_delegate respondsToSelector:@selector(textDidEndEditing:)]) return [text_delegate textDidEndEditing:aNotification]; } @@ -396,14 +393,6 @@ id MB_NSTEXTFIELDCELL_CLASS; return YES; } -// -// Manage the cursor -// -- (void)resetCursorRects -{ - [self addCursorRect: bounds cursor: text_cursor]; -} - // // NSCoding protocol // @@ -411,9 +400,15 @@ id MB_NSTEXTFIELDCELL_CLASS; { [super encodeWithCoder:aCoder]; +#if 0 [aCoder encodeObjectReference: next_text withName: @"Next text"]; [aCoder encodeObjectReference: previous_text withName: @"Previous text"]; [aCoder encodeObjectReference: text_delegate withName: @"Text delegate"]; +#else + [aCoder encodeConditionalObject:next_text]; + [aCoder encodeConditionalObject:previous_text]; + [aCoder encodeConditionalObject:text_delegate]; +#endif [aCoder encodeValueOfObjCType: @encode(SEL) at: &error_action]; } @@ -421,9 +416,15 @@ id MB_NSTEXTFIELDCELL_CLASS; { [super initWithCoder:aDecoder]; +#if 0 [aDecoder decodeObjectAt: &next_text withName: NULL]; [aDecoder decodeObjectAt: &previous_text withName: NULL]; [aDecoder decodeObjectAt: &text_delegate withName: NULL]; +#else + next_text = [aDecoder decodeObject]; + previous_text = [aDecoder decodeObject]; + text_delegate = [aDecoder decodeObject]; +#endif [aDecoder decodeValueOfObjCType: @encode(SEL) at: &error_action]; return self; diff --git a/Source/NSTextFieldCell.m b/Source/NSTextFieldCell.m index a6d29893c..0cae7dcfa 100644 --- a/Source/NSTextFieldCell.m +++ b/Source/NSTextFieldCell.m @@ -26,11 +26,13 @@ 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ -#include -#include -#include #include -#include +#include +#include +#include +#include +#include +#include // // TextFieldCell implementation @@ -60,7 +62,7 @@ // - init { - [self initTextCell:[NSString stringWithCString:"Field"]]; + [self initTextCell:@""]; return self; } diff --git a/Source/NSView.m b/Source/NSView.m index 23727dbd1..96c68ff73 100644 --- a/Source/NSView.m +++ b/Source/NSView.m @@ -26,22 +26,24 @@ 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ -#include -#include -#include -#include -#include -#include +#include +#include +#include +#include +#include +#include +#include +#include // // Class variables // -NSMutableDictionary *gnustep_gui_nsview_thread_dict; -NSRecursiveLock *gnustep_gui_nsview_lock; +static NSMutableDictionary *gnustep_gui_nsview_thread_dict = nil; +static NSRecursiveLock *gnustep_gui_nsview_lock = nil; // NSView notifications -NSString *NSViewFrameChangedNotification; -NSString *NSViewFocusChangedNotification; +NSString *NSViewFrameChangedNotification = @"NSViewFrameChangedNotification"; +NSString *NSViewFocusChangedNotification = @"NSViewFocusChangedNotification"; @implementation NSView @@ -153,9 +155,6 @@ NSString *NSViewFocusChangedNotification; // Initialize tracking rectangle list tracking_rects = [NSMutableArray array]; - // Initialize cursor rect list - cursor_rects = [NSMutableArray array]; - super_view = nil; window = nil; is_flipped = NO; @@ -188,11 +187,6 @@ NSString *NSViewFocusChangedNotification; for (i = 0;i < j; ++i) [[tracking_rects objectAtIndex:i] release]; - // Free the cursor rectangles - j = [cursor_rects count]; - for (i = 0;i < j; ++i) - [[cursor_rects objectAtIndex:i] release]; - [super dealloc]; } @@ -202,22 +196,10 @@ NSString *NSViewFocusChangedNotification; - (void)addSubview:(NSView *)aView { // Not a NSView --then forget it - // xxx but NSView will really be the backend class - // so how do we check that its really a subclass of NSView - // and not of the backend class? -#if 0 if (![aView isKindOfClass:[NSView class]]) { return; } -#endif - - // make sure we aren't making ourself a subview of ourself - if (self == aView) - { - NSLog(@"Attempt to make view a subview of itself\n"); - return; - } // retain the object [aView retain]; @@ -234,14 +216,9 @@ NSString *NSViewFocusChangedNotification; relativeTo:(NSView *)otherView { // Not a NSView --then forget it - // xxx but NSView will really be the backend class - // so how do we check that its really a subclass of NSView - // and not of the backend class? -#if 0 if (![aView isKindOfClass:[NSView class]]) return; -#endif - // retain the object + // retain the object [aView retain]; // Add to our subview list @@ -258,24 +235,14 @@ NSString *NSViewFocusChangedNotification; - (NSView *)ancestorSharedWithView:(NSView *)aView { NSView *v = nil; - BOOL found = NO; return v; } - (BOOL)isDescendantOf:(NSView *)aView { - int i, j; - NSView *v; - BOOL found = NO; - // Not a NSView --then forget it - // xxx but NSView will really be the backend class - // so how do we check that its really a subclass of NSView - // and not of the backend class? -#if o if (![aView isKindOfClass:[NSView class]]) return NO; -#endif // Quick check if (aView == self) return YES; @@ -317,12 +284,7 @@ NSString *NSViewFocusChangedNotification; NSView *v; // Not a NSView --then forget it - // xxx but NSView will really be the backend class - // so how do we check that its really a subclass of NSView - // and not of the backend class? -#if 0 if (![newView isKindOfClass:[NSView class]]) return; -#endif j = [sub_views count]; for (i = 0;i < j; ++i) @@ -360,12 +322,7 @@ NSString *NSViewFocusChangedNotification; - (void)setSuperview:(NSView *)superview { // Not a NSView --then forget it - // xxx but NSView will really be the backend class - // so how do we check that its really a subclass of NSView - // and not of the backend class? -#if 0 if (![superview isKindOfClass:[NSView class]]) return; -#endif super_view = superview; } @@ -553,7 +510,6 @@ NSString *NSViewFocusChangedNotification; fromView:(NSView *)aView { NSPoint p, q; - NSRect r; // Must belong to the same window if (([self window] != [aView window]) && (aView)) @@ -855,55 +811,20 @@ NSString *NSViewFocusChangedNotification; // // Managing the Cursor // -// We utilize the tracking rectangle class -// to also maintain the cursor rects -// - (void)addCursorRect:(NSRect)aRect cursor:(NSCursor *)anObject -{ - TrackingRectangle *m; - - m = [[TrackingRectangle alloc] initWithRect: aRect tag: 0 owner: anObject - userData: NULL inside: YES]; - [cursor_rects addObject:m]; -} +{} - (void)discardCursorRects -{ - [cursor_rects removeAllObjects]; -} +{} - (void)removeCursorRect:(NSRect)aRect cursor:(NSCursor *)anObject -{ - id e = [cursor_rects objectEnumerator]; - TrackingRectangle *o; - NSCursor *c; - BOOL found = NO; - - // Base remove test upon cursor object - o = [e nextObject]; - while (o && (!found)) - { - c = [o owner]; - if (c == anObject) - found = YES; - else - o = [e nextObject]; - } - - if (found) - [cursor_rects removeObject: o]; -} +{} - (void)resetCursorRects {} -- (NSArray *)cursorRectangles -{ - return cursor_rects; -} - // // Assigning a Tag // @@ -1187,9 +1108,19 @@ NSString *NSViewFocusChangedNotification; NSDebugLog(@"NSView: start encoding\n"); [aCoder encodeRect: frame]; [aCoder encodeRect: bounds]; +#if 0 [aCoder encodeObjectReference: super_view withName: @"Superview"]; +#else + [aCoder encodeConditionalObject:super_view]; +#endif + [aCoder encodeObject: sub_views]; + +#if 0 [aCoder encodeObjectReference: window withName: @"Window"]; +#else + [aCoder encodeConditionalObject:window]; +#endif [aCoder encodeObject: tracking_rects]; [aCoder encodeValueOfObjCType:@encode(BOOL) at: &is_flipped]; [aCoder encodeValueOfObjCType:@encode(BOOL) at: &is_rotated_from_base]; @@ -1210,9 +1141,20 @@ NSString *NSViewFocusChangedNotification; NSDebugLog(@"NSView: start decoding\n"); frame = [aDecoder decodeRect]; bounds = [aDecoder decodeRect]; +#if 0 [aDecoder decodeObjectAt: &super_view withName: NULL]; +#else + super_view = [aDecoder decodeObject]; +#endif + sub_views = [aDecoder decodeObject]; + +#if 0 [aDecoder decodeObjectAt: &window withName: NULL]; +#else + window = [aDecoder decodeObject]; +#endif + tracking_rects = [aDecoder decodeObject]; [aDecoder decodeValueOfObjCType:@encode(BOOL) at: &is_flipped]; [aDecoder decodeValueOfObjCType:@encode(BOOL) at: &is_rotated_from_base]; diff --git a/Source/NSWindow.m b/Source/NSWindow.m index 5e910f54a..e263f11e6 100644 --- a/Source/NSWindow.m +++ b/Source/NSWindow.m @@ -27,14 +27,17 @@ 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ -#include -#include -#include -#include -#include -#include -#include -#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include // NSWindow notifications NSString *NSWindowDidBecomeKeyNotification = @"WindowDidBecomeKey"; @@ -177,10 +180,6 @@ NSString *NSWindowWillMoveNotification = @"WindowWillMove"; // Next responder is the application [self setNextResponder:theApp]; - // Cursor management - cursor_rects_enabled = YES; - cursor_rects_valid = NO; - // Create our content view [self setContentView:[[NSView alloc] initWithFrame:frame]]; @@ -353,9 +352,6 @@ NSString *NSWindowWillMoveNotification = @"WindowWillMove"; // We are the key window is_key = YES; - // Reset the cursor rects - [self resetCursorRects]; - // Post notification [nc postNotificationName: NSWindowDidBecomeKeyNotification object: self]; } @@ -478,9 +474,6 @@ NSString *NSWindowWillMoveNotification = @"WindowWillMove"; is_key = NO; - // Discard the cursor rects - [self discardCursorRects]; - // Post notification [nc postNotificationName: NSWindowDidResignKeyNotification object: self]; } @@ -726,26 +719,8 @@ NSString *NSWindowWillMoveNotification = @"WindowWillMove"; cursor_rects_enabled = NO; } -- (void)discardCursorRectsForView:(NSView *)theView -{ - NSArray *s; - id e; - NSView *v; - - // Discard for the view - [theView discardCursorRects]; - - // Discard for the view's subviews - s = [theView subviews]; - e = [s objectEnumerator]; - while ((v = [e nextObject])) - [self discardCursorRectsForView: v]; -} - - (void)discardCursorRects -{ - [self discardCursorRectsForView: content_view]; -} +{} - (void)enableCursorRects { @@ -753,34 +728,10 @@ NSString *NSWindowWillMoveNotification = @"WindowWillMove"; } - (void)invalidateCursorRectsForView:(NSView *)aView -{ - cursor_rects_valid = NO; -} - -- (void)resetCursorRectsForView:(NSView *)theView -{ - NSArray *s; - id e; - NSView *v; - - // Reset the view - [theView resetCursorRects]; - - // Reset the view's subviews - s = [theView subviews]; - e = [s objectEnumerator]; - while ((v = [e nextObject])) - [self resetCursorRectsForView: v]; -} +{} - (void)resetCursorRects -{ - // Tell all the views to reset their cursor rects - [self resetCursorRectsForView: content_view]; - - // Cursor rects are now valid - cursor_rects_valid = YES; -} +{} // // Handling user actions and events @@ -980,31 +931,27 @@ NSString *NSWindowWillMoveNotification = @"WindowWillMove"; // Mouse entered event if ((!last) && (now)) { - id owner = [r owner]; e = [NSEvent enterExitEventWithType:NSMouseEntered location:[theEvent locationInWindow] modifierFlags:[theEvent modifierFlags] timestamp:0 windowNumber:[theEvent windowNumber] context:NULL eventNumber:0 trackingNumber:[r tag] userData:[r userData]]; - // Send the event to the owner - if ([owner respondsToSelector:@selector(mouseEntered:)]) - [owner mouseEntered:e]; + // Send the event to the view + [theView mouseEntered:e]; } // Mouse exited event if ((last) && (!now)) { - id owner = [r owner]; e = [NSEvent enterExitEventWithType:NSMouseExited location:[theEvent locationInWindow] modifierFlags:[theEvent modifierFlags] timestamp:0 windowNumber:[theEvent windowNumber] context:NULL eventNumber:0 trackingNumber:[r tag] userData:[r userData]]; - // Send the event to the owner - if ([owner respondsToSelector:@selector(mouseExited:)]) - [owner mouseExited:e]; + // Send the event to the view + [theView mouseExited:e]; } } @@ -1014,81 +961,12 @@ NSString *NSWindowWillMoveNotification = @"WindowWillMove"; [self checkTrackingRectangles:[sb objectAtIndex:i] forEvent:theEvent]; } -- (void)checkCursorRectangles:(NSView *)theView forEvent:(NSEvent *)theEvent -{ - NSArray *tr = [theView cursorRectangles]; - NSArray *sb = [theView subviews]; - TrackingRectangle *r; - int i, j; - BOOL last, now; - NSEvent *e; - NSRect convRect; - NSPoint loc = [theEvent locationInWindow]; - - // Loop through cursor rectangles - j = [tr count]; - for (i = 0;i < j; ++i) - { - // Convert cursor rectangle to window coordinates - r = (TrackingRectangle *)[tr objectAtIndex:i]; - convRect = [r rectangle]; - convRect = [theView convertRect: convRect toView: nil]; - // Check mouse at last point - last = [theView mouse:last_point inRect: convRect]; - // Check mouse at current point - now = [theView mouse: loc inRect: convRect]; - - // Mouse entered - if ((!last) && (now)) - { - // Post cursor update event - e = [NSEvent enterExitEventWithType: NSCursorUpdate - location: loc - modifierFlags: [theEvent modifierFlags] - timestamp: 0 - windowNumber: [theEvent windowNumber] - context: [theEvent context] - eventNumber: 0 - trackingNumber: (int)YES - userData: (void *)r]; - [self postEvent: e atStart: YES]; - } - - // Mouse exited event - if ((last) && (!now)) - { - // Post cursor update event - e = [NSEvent enterExitEventWithType: NSCursorUpdate - location: loc - modifierFlags: [theEvent modifierFlags] - timestamp: 0 - windowNumber: [theEvent windowNumber] - context: [theEvent context] - eventNumber: 0 - trackingNumber: (int)NO - userData: (void *)r]; - [self postEvent: e atStart: YES]; - } - } - - // Check the cursor rectangles for the subviews - j = [sb count]; - for (i = 0;i < j; ++i) - [self checkCursorRectangles:[sb objectAtIndex:i] forEvent:theEvent]; -} - - (void)sendEvent:(NSEvent *)theEvent { - // If the cursor rects are invalid - // Then discard and reset - if (!cursor_rects_valid) - { - [self discardCursorRects]; - [self resetCursorRects]; - } switch ([theEvent type]) { + // // Mouse events // @@ -1149,13 +1027,6 @@ NSString *NSWindowWillMoveNotification = @"WindowWillMove"; // should send a NSMouseEntered or NSMouseExited event [self checkTrackingRectangles:content_view forEvent:theEvent]; - // We need to go through all of the views, and any with - // a cursor rectangle then we need to determine if we - // should send a cursor update event - // We only do this if we are the key window - if ([self isKeyWindow]) - [self checkCursorRectangles: content_view forEvent: theEvent]; - last_point = [theEvent locationInWindow]; break; } @@ -1227,22 +1098,12 @@ NSString *NSWindowWillMoveNotification = @"WindowWillMove"; // case NSCursorUpdate: { - // Is it a mouse entered - if ([theEvent trackingNumber]) - { - // push the cursor - TrackingRectangle *r = (TrackingRectangle *)[theEvent userData]; - NSCursor *c = (NSCursor *)[r owner]; - [c push]; - } - else - { - // it is a mouse exited - // so pop the cursor - [NSCursor pop]; - } break; } + case NSPeriodic: + { + break; + } } } @@ -1354,7 +1215,7 @@ NSString *NSWindowWillMoveNotification = @"WindowWillMove"; // - (BOOL)windowShouldClose:sender { - if ([delegate respondsTo:@selector(windowShouldClose:)]) + if ([delegate respondsToSelector:@selector(windowShouldClose:)]) return [delegate windowShouldClose:sender]; else return YES; @@ -1363,7 +1224,7 @@ NSString *NSWindowWillMoveNotification = @"WindowWillMove"; - (NSSize)windowWillResize:(NSWindow *)sender toSize:(NSSize)frameSize { - if ([delegate respondsTo:@selector(windowWillResize:toSize:)]) + if ([delegate respondsToSelector:@selector(windowWillResize:toSize:)]) return [delegate windowWillResize:sender toSize:frameSize]; else return frameSize; @@ -1377,85 +1238,85 @@ NSString *NSWindowWillMoveNotification = @"WindowWillMove"; - (void)windowDidBecomeKey:(NSNotification *)aNotification { - if ([delegate respondsTo:@selector(windowDidBecomeKey:)]) + if ([delegate respondsToSelector:@selector(windowDidBecomeKey:)]) return [delegate windowDidBecomeKey:aNotification]; } - (void)windowDidBecomeMain:(NSNotification *)aNotification { - if ([delegate respondsTo:@selector(windowDidBecomeMain:)]) + if ([delegate respondsToSelector:@selector(windowDidBecomeMain:)]) return [delegate windowDidBecomeMain:aNotification]; } - (void)windowDidChangeScreen:(NSNotification *)aNotification { - if ([delegate respondsTo:@selector(windowDidChangeScreen:)]) + if ([delegate respondsToSelector:@selector(windowDidChangeScreen:)]) return [delegate windowDidChangeScreen:aNotification]; } - (void)windowDidDeminiaturize:(NSNotification *)aNotification { - if ([delegate respondsTo:@selector(windowDidDeminiaturize:)]) + if ([delegate respondsToSelector:@selector(windowDidDeminiaturize:)]) return [delegate windowDidDeminiaturize:aNotification]; } - (void)windowDidExpose:(NSNotification *)aNotification { - if ([delegate respondsTo:@selector(windowDidExpose:)]) + if ([delegate respondsToSelector:@selector(windowDidExpose:)]) return [delegate windowDidExpose:aNotification]; } - (void)windowDidMiniaturize:(NSNotification *)aNotification { - if ([delegate respondsTo:@selector(windowDidMiniaturize:)]) + if ([delegate respondsToSelector:@selector(windowDidMiniaturize:)]) return [delegate windowDidMiniaturize:aNotification]; } - (void)windowDidMove:(NSNotification *)aNotification { - if ([delegate respondsTo:@selector(windowDidMove:)]) + if ([delegate respondsToSelector:@selector(windowDidMove:)]) return [delegate windowDidMove:aNotification]; } - (void)windowDidResignKey:(NSNotification *)aNotification { - if ([delegate respondsTo:@selector(windowDidResignKey:)]) + if ([delegate respondsToSelector:@selector(windowDidResignKey:)]) return [delegate windowDidResignKey:aNotification]; } - (void)windowDidResignMain:(NSNotification *)aNotification { - if ([delegate respondsTo:@selector(windowDidResignMain:)]) + if ([delegate respondsToSelector:@selector(windowDidResignMain:)]) return [delegate windowDidResignMain:aNotification]; } - (void)windowDidResize:(NSNotification *)aNotification { - if ([delegate respondsTo:@selector(windowDidResize:)]) + if ([delegate respondsToSelector:@selector(windowDidResize:)]) return [delegate windowDidResize:aNotification]; } - (void)windowDidUpdate:(NSNotification *)aNotification { - if ([delegate respondsTo:@selector(windowDidUpdate:)]) + if ([delegate respondsToSelector:@selector(windowDidUpdate:)]) return [delegate windowDidUpdate:aNotification]; } - (void)windowWillClose:(NSNotification *)aNotification { - if ([delegate respondsTo:@selector(windowWillClose:)]) + if ([delegate respondsToSelector:@selector(windowWillClose:)]) return [delegate windowWillClose:aNotification]; } - (void)windowWillMiniaturize:(NSNotification *)aNotification { - if ([delegate respondsTo:@selector(windowWillMiniaturize:)]) + if ([delegate respondsToSelector:@selector(windowWillMiniaturize:)]) return [delegate windowWillMiniaturize:aNotification]; } - (void)windowWillMove:(NSNotification *)aNotification { - if ([delegate respondsTo:@selector(windowWillMove:)]) + if ([delegate respondsToSelector:@selector(windowWillMove:)]) return [delegate windowWillMove:aNotification]; } @@ -1464,8 +1325,6 @@ NSString *NSWindowWillMoveNotification = @"WindowWillMove"; // - (void)encodeWithCoder:aCoder { - NSApplication *theApp = [NSApplication sharedApplication]; - [self setNextResponder: nil]; [super encodeWithCoder:aCoder]; diff --git a/Source/NSWorkspace.m b/Source/NSWorkspace.m index e76b7c4c3..8667ce243 100644 --- a/Source/NSWorkspace.m +++ b/Source/NSWorkspace.m @@ -26,36 +26,36 @@ 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ -#include +#include // Workspace File Type Globals -NSString *NSPlainFileType; -NSString *NSDirectoryFileType; -NSString *NSApplicationFileType; -NSString *NSFilesystemFileType; -NSString *NSShellCommandFileType; +NSString *NSPlainFileType = @"NSPlainFileType"; +NSString *NSDirectoryFileType = @"NSDirectoryFileType"; +NSString *NSApplicationFileType = @"NSApplicationFileType"; +NSString *NSFilesystemFileType = @"NSFilesystemFileType"; +NSString *NSShellCommandFileType = @"NSShellCommandFileType"; // Workspace File Operation Globals -NSString *NSWorkspaceCompressOperation; -NSString *NSWorkspaceCopyOperation; -NSString *NSWorkspaceDecompressOperation; -NSString *NSWorkspaceDecryptOperation; -NSString *NSWorkspaceDestroyOperation; -NSString *NSWorkspaceDuplicateOperation; -NSString *NSWorkspaceEncryptOperation; -NSString *NSWorkspaceLinkOperation; -NSString *NSWorkspaceMoveOperation; -NSString *NSWorkspaceRecycleOperation; +NSString *NSWorkspaceCompressOperation = @"NSWorkspaceCompressOperation"; +NSString *NSWorkspaceCopyOperation = @"NSWorkspaceCopyOperation"; +NSString *NSWorkspaceDecompressOperation = @"NSWorkspaceDecompressOperation"; +NSString *NSWorkspaceDecryptOperation = @"NSWorkspaceDecryptOperation"; +NSString *NSWorkspaceDestroyOperation = @"NSWorkspaceDestroyOperation"; +NSString *NSWorkspaceDuplicateOperation = @"NSWorkspaceDuplicateOperation"; +NSString *NSWorkspaceEncryptOperation = @"NSWorkspaceEncryptOperation"; +NSString *NSWorkspaceLinkOperation = @"NSWorkspaceLinkOperation"; +NSString *NSWorkspaceMoveOperation = @"NSWorkspaceMoveOperation"; +NSString *NSWorkspaceRecycleOperation = @"NSWorkspaceRecycleOperation"; // NSWorkspace notifications -NSString *NSWorkspaceDidLaunchApplicationNotification; -NSString *NSWorkspaceDidMountNotification; -NSString *NSWorkspaceDidPerformFileOperationNotification; -NSString *NSWorkspaceDidTerminateApplicationNotification; -NSString *NSWorkspaceDidUnmountNotification; -NSString *NSWorkspaceWillLaunchApplicationNotification; -NSString *NSWorkspaceWillPowerOffNotification; -NSString *NSWorkspaceWillUnmountNotification; +NSString *NSWorkspaceDidLaunchApplicationNotification = @"NSWorkspaceDidLaunchApplicationNotification"; +NSString *NSWorkspaceDidMountNotification = @"NSWorkspaceDidMountNotification"; +NSString *NSWorkspaceDidPerformFileOperationNotification = @"NSWorkspaceDidPerformFileOperationNotification"; +NSString *NSWorkspaceDidTerminateApplicationNotification = @"NSWorkspaceDidTerminateApplicationNotification"; +NSString *NSWorkspaceDidUnmountNotification = @"NSWorkspaceDidUnmountNotification"; +NSString *NSWorkspaceWillLaunchApplicationNotification = @"NSWorkspaceWillLaunchApplicationNotification"; +NSString *NSWorkspaceWillPowerOffNotification = @"NSWorkspaceWillPowerOffNotification"; +NSString *NSWorkspaceWillUnmountNotification = @"NSWorkspaceWillUnmountNotification"; @implementation NSWorkspace diff --git a/Source/TrackingRectangle.m b/Source/TrackingRectangle.m index fa2025c70..e5dd02c45 100644 --- a/Source/TrackingRectangle.m +++ b/Source/TrackingRectangle.m @@ -99,7 +99,6 @@ // - (void)encodeWithCoder:aCoder { - [super encodeWithCoder:aCoder]; [aCoder encodeRect:rectangle]; [aCoder encodeValueOfObjCType:@encode(NSTrackingRectTag) at:&tag]; [aCoder encodeObject:owner]; @@ -108,7 +107,6 @@ - initWithCoder:aDecoder { - [super initWithCoder:aDecoder]; rectangle = [aDecoder decodeRect]; [aDecoder decodeValueOfObjCType:@encode(NSTrackingRectTag) at:&tag]; [aDecoder decodeValueOfObjCType:@encode(BOOL) at:&inside]; diff --git a/Source/libgnustep-gui.m b/Source/libgnustep-gui.m index d1c59813f..02000e96a 100644 --- a/Source/libgnustep-gui.m +++ b/Source/libgnustep-gui.m @@ -26,11 +26,13 @@ 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ -#include +#include +#include +#include -id NSApp; +id NSApp = nil; -char **NSArgv; +char **NSArgv = NULL; // // The main entry point for X Windows @@ -55,4 +57,6 @@ GNUstepMain(int argc, char **argv) // Release the application [NSApp release]; + + return 0; } diff --git a/Source/tiff.m b/Source/tiff.m index 54b465269..e9e0585e5 100644 --- a/Source/tiff.m +++ b/Source/tiff.m @@ -54,8 +54,11 @@ * OF THIS SOFTWARE. */ -#include +//#include #include +#include +#include + #include #include #include diff --git a/Testing/.cvsignore b/Testing/.cvsignore new file mode 100644 index 000000000..f3c7a7c5d --- /dev/null +++ b/Testing/.cvsignore @@ -0,0 +1 @@ +Makefile